mapnik / python-mapnik

Python bindings for mapnik
GNU Lesser General Public License v2.1
160 stars 91 forks source link

getting blank image in output #277

Open pdpsinghr opened 4 months ago

pdpsinghr commented 4 months ago

import mapnik m = mapnik.Map(1024, 768, '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs') mapnik_xml_path = '/usr/share/renderd/example-map/xml/2024_05_20_07_amd.xml' m.srs = '+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs' mapnik.load_map(m, mapnik_xml_path) bbox = mapnik.Box2d(-122.4,37.8, -122.3, 37.9) m.zoom_to_box(bbox) img = mapnik.Image(1024, 768) mapnik.render(m, img) img.save('output_image.png')

this is my python code but in response i am getting blank image