Hello,
I want to render some data, but I can’t do it.
I am using this tutorial: http://wiki.openstreetmap.org/wiki/Mapnik:_Rendering_OSM_XML_data_directly
I have downloaded schwaben-latest.osm.bz2 and extracted it into /tmp/mapnik.
Further I downloaded mapnik_style.xml in the same folder.
Now I want to render:
cd /tmp/mapnik
python
Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from mapnik import *
>>> mapfile = 'mapnik_style.xml'
>>> map_output = 'mymap.png'
>>> m = Map(4*1024,4*1024)
>>> load_map(m, mapfile)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: Failed to parse expression: "name" in style 'highways' in TextSymbolizer at line 19 of 'mapnik_style.xml'
If I ignore the error and just go on, this happens:
>>> bbox=(Envelope( 10.0,47.5,11.1,48.1 ))
>>> m.zoom_to_box(bbox)
>>> print "Scale = " , m.scale()
Scale = 0.0002685546875
>>> render_to_file(m, map_output)
>>>
After that I get a complete transparent png.
I can’t figure out, where the mistake is. Why does the parsing process fail? How can I fix it?