http://wiki.openstreetmap.org/index.php/Mapnik/Installation useradd osm Nainstalovat Postgis ==================== > http://wiki.openstreetmap.org/wiki/Mapnik/PostGIS#For_Debian_etch_.28onwards.29 > nastavení - /etc/postgresql/8.3/main/postgresql.conf shared_buffers = 128MB # dávám 64, default 24 checkpoint_segments = 20 maintenance_work_mem = 256MB # dávám 64, default 16 > databáze + postgis -- odpověď všechny ne, příkazy vyvolat zvlášť! su - postgres createuser osm createdb -E UTF8 -O osm gis createlang plpgsql gis psql -d gis -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql echo "ALTER TABLE geometry_columns OWNER TO osm; ALTER TABLE spatial_ref_sys OWNER TO osm;" | psql -d gis Nainstalovat mapnik =================== apt-get install python-mapnik nebo http://wiki.openstreetmap.org/wiki/Mapnik/Installation + apt-get install imagemagick apt-get install osm2pgsql nebo http://wiki.openstreetmap.org/wiki/Osm2pgsql, VERSION=http://svn.openstreetmap.org/applications/utils/export/osm2pgsql/Makefile nastavit projekci: echo "INSERT INTO spatial_ref_sys (srid, auth_name, auth_srid, srtext, proj4text)VALUES (900913,'EPSG',900913,'PROJCS["WGS84 / Simple Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS_1984", 6378137.0, 298.257223563]],PRIMEM["Greenwich", 0.0],UNIT["degree", 0.017453292519943295],AXIS["Longitude", EAST],AXIS["Latitude", NORTH]],PROJECTION["Mercator_1SP_Google"],PARAMETER["latitude_of_origin", 0.0],PARAMETER["central_meridian", 0.0],PARAMETER["scale_factor", 1.0],PARAMETER["false_easting", 0.0],PARAMETER["false_northing", 0.0],UNIT["m", 1.0],AXIS["x", EAST],AXIS["y", NORTH],AUTHORITY["EPSG","900913"]]','+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs');" | psql -d gis Stáhnout osm soubor a naloadovat data ===================================== wget http://download.geofabrik.de/osm/europe/czech_republic.osm.bz2 nebo http://wiki.openstreetmap.org/wiki/Mapnik#DataSets osm2pgsql -m -d gis czech_republic.osm.bz2 ... RAM: 330mb, čas cca 15minut - Node(4920k) Way(387k) Relation(4k) cd ~ svn checkout http://svn.openstreetmap.org/applications/rendering/mapnik wget http://tile.openstreetmap.org/world_boundaries-spherical.tgz wget http://tile.openstreetmap.org/processed_p.zip wget http://tile.openstreetmap.org/shoreline_300.tar.bz2 tar xzf world_boundaries-spherical.tgz unzip processed_p.zip mv coastlines/* world_boundaries/ rmdir coastlines tar xjf shoreline_300.tar.bz2 -C world_boundaries mv world_boundaries/ mapnik/ cd mapnik/ REnder ====== http://wiki.openstreetmap.org/wiki/Mapnik#Rendering_with_Mapnik Můj generate_tiles.py pro čechy minZoom = 8 maxZoom = 16 bbox = (14.05,49.849, 14.815,50.325) render_tiles(bbox, mapfile, tile_dir, minZoom, maxZoom , "Praha") WMS Server ========== Zajímave: http://wiki.openstreetmap.org/wiki/WMS Mapnik ho už obsahuje, stačí následovat: http://code.google.com/p/mapnik-utils/wiki/WmsInstallGuide a http://trac.mapnik.org/browser/trunk/docs/ogcserver/readme.txt Má to dost závislostí: * Stáhnout jonpy + python setup.py install * apt-get install python-imaging python-lxml >PSQL error: FATAL: Ident authentication failed for user "osm" in layer 'leisure' Postgre nezná aktuálního uživatele, je nutné povolit www-data viz http://www.depesz.com/index.php/2007/10/04/ident/ >"importError: No module named ogcserver.cgiserver" Spouštěl jsem "python" ve složce, kde byl i mapnik.py, takže to dalo přednost tomuto souboru před modulem.