Mapnik/Installation on Fedora 18
< MapnikJump to navigation Jump to search
This page has been labelled for deletion.
The given reason is: The page is outdated and has not been maintained for years. Osm2pgsql moved to Git a few years ago. Setting up a tile server or components of it is covered by switch2osm.org. Although the instructions there refere to Ubuntu any skilled Linux administrator should be able to transfer them to his/her preferred distribution. --Nakaner (talk) 08:04, 6 August 2019 (UTC)
Nobody voiced opposition so far. --Nakaner (talk) 15:03, 2 December 2019 (UTC).
This normally means the page title is a bad one, and the content has been moved somewhere better. If a page title is vaguely meaningful, the page should perhaps be a redirect, or hold a small summary for historical interest instead. If you disagree with its deletion, please explain why on its talk page.
The page should now be empty apart from this message (as per procedure). The page history shows what used to be on this page, and allows people to rescue an old revision. We may decide to do this, but otherwise a wiki sysop user can delete this page more permanently at some point. In the meantime we should fix any pages linking to here.
|The information on this page is quite old, and some parts (such as the reliance on subversion) may need updating.|
- July 3, 2013
- Install and run the database server if you haven't done this before (as root)
yum install postgresql-server postgresql-setup initdb systemctl start postgresql
Optionally set the service to start automatically
systemctl enable postgresql
- Install the postgres postgis extension (as root)
yum install postgis
- Setup the database
optionally, set password for the database user (as root)
otherwise run "su - postgres" as root
su - postgres createdb -EUNICODE gis createuser -S -D -R apache echo "GRANT ALL ON SCHEMA PUBLIC TO apache;" | psql gis psql gis < /usr/share/pgsql/contrib/postgis-64.sql psql gis < /usr/share/pgsql/contrib/spatial_ref_sys.sql echo "grant all on geometry_columns to apache;" | psql gis echo "grant all on spatial_ref_sys to apache;" | psql gis
Note - on a 32 bit system change postgis-64.sql to postgis.sql on the 6th line above.
- Create your OSM working dir and checkout osm2pgsql project
mkdir ~/osm cd ~/osm svn co http://svn.openstreetmap.org/applications/utils/export/osm2pgsql/ cd osm2pgsql
- To build osm2pgsql, follow Osm2pgsql#Fedora
- Download osm data - for example:
- Import the map.osm into the gis database
cp -r ~/osm/osm2pgsql /tmp cp ~/osm/map.osm /tmp ./osm2pgsql -S ./default.style ../map.osm
- Install mapnik
yum install mapnik mapnik-devel mapnik-python proj-epsg
- Checkout mapnik data from svn
cd ~/osm svn co http://svn.openstreetmap.org/applications/rendering/mapnik
- Download the Coastline data
wget http://tile.openstreetmap.org/world_boundaries-spherical.tgz wget http://tile.openstreetmap.org/processed_p.tar.bz2 wget http://tile.openstreetmap.org/shoreline_300.tar.bz2
- Files required since June 2010
wget http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_populated_places.zip wget http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_admin_0_boundary_lines_land.zip
- Unpack them up properly
cd ~/osm/mapnik tar xvzf world_boundaries-spherical.tgz tar xvjf processed_p.tar.bz2 -C world_boundaries tar xvjf shoreline_300.tar.bz2 -C world_boundaries unzip ne_10m-populated-places.zip -d world_boundaries unzip ne_110m-admin-0-boundary-lines_land.zip -d world_boundaries
- Setup the mapnik environment
cd ~/osm/mapnik cp archive/set-mapnik-env . vim set-mapnik-env change "export MAPNIK_DBNAME='osm'" to 'gis' change "export MAPNIK_DBUSER=`whoami`" to 'apache'
- Test mapnik
cp ~/osm/mapnik/generate_tiles.py ~/osm/mapnik/z0_generate_tiles.py
vim ~/osm/mapnik/z0_generate_tiles.py #------------------------------------------------------------------------- # # Change the following for different bounding boxes and zoom levels # # Start with an overview # World bbox = (-180.0,-90.0, 180.0,90.0) render_tiles(bbox, mapfile, tile_dir, 0, 5, "World") Change the 5 to 0, then Comment out all of the render_tiles line that follows with a '#'
- Copy/run mapnik
cp -r ~/osm/mapnik ~ cd ~/mapnik/ source set-mapnik-env ./z0_generate_tiles.py
- Check file tiles/0/0/0.png is a world map image