I have installed the latest Mapnik renderer following the information on their website and exported a .pbf file to a local PostGIS DB using this command:
osm2pgsql --style ../openstreetmap-carto/openstreetmap-carto.style --create --database gis -U maps -W -H 192.168.220.137 bucharest.osm.pbf
After this I generated a XML style sheet using
carto -a "3.0.0" ../openstreetmap-carto/project.mml > mapnik.xml
Now I would like to use this mapnik.xml in a Python script to render a part of the exported map from PostGIS as a test.
#!/usr/bin/env python from mapnik import * mapfile = 'mapnik.xml' map_output = 'mymap33.png' m = Map(2048, 2048) load_map(m, mapfile) bbox=(Box2d( 26.08901,44.420234,26.125488,44.435067)) #m.zoom_to_box(bbox) render_to_file(m, map_output)
The problem is that the mapnik.xml has no information about my PostGIS DB (I looked in the file and I saw a lot of queries in element but no host name, user name or password). How do I add more info about my PostGIS DB to this style sheet?