Talk:Ceyx
SyntaxError with older Python version
When running Ceyx, I'm encountering this error:
Traceback (most recent call last):
File "./osm2png.py", line 307, in <module>
osm2svg.render(size, height, outfilepath= outfile)
File "./osm2png.py", line 114, in render
png = renderer.render_png(self.osmparser, self.zoom, width, height)
File "/home/tordanik/3dMap/ceyx/ceyx/OSMrenderer.py", line 676, in render_png
self.render_layer(base_layer)
File "/home/tordanik/3dMap/ceyx/ceyx/OSMrenderer.py", line 602, in render_layer
self.render_way(ele, rules, z_index, ctx)
File "/home/tordanik/3dMap/ceyx/ceyx/OSMrenderer.py", line 370, in render_way
way_ele = self.osmparser.root.find("way[@id='%s']" % wayid)
File "/usr/lib/python2.6/xml/etree/ElementTree.py", line 330, in find
return ElementPath.find(self, path)
File "/usr/lib/python2.6/xml/etree/ElementPath.py", line 186, in find
return _compile(path).find(element)
File "/usr/lib/python2.6/xml/etree/ElementPath.py", line 176, in _compile
p = Path(path)
File "/usr/lib/python2.6/xml/etree/ElementPath.py", line 93, in __init__
"expected path separator (%s)" % (op or tag)
SyntaxError: expected path separator ([)
I'm getting this on a machine with Python 2.6.6 (from the Ubuntu 10.10 repositories), whereas 2.7.2 works fine. A bit of experimentation shows that the error is triggered for a way that is missing in a relation. With the newer version, Ceyx will print "WARNING: Missing way 39613023 in relation. Dropping relation" in this situation. It seems that etree, where the exception occurs, has a different version (1.2.6 vs. 1.3.0) in the different Python versions, which might cause the different behaviour.
Am I doing anything wrong or does Ceyx need Python >= 2.7, rather than >= 2.5 as stated in the instructions? --Tordanik 06:53, 3 December 2011 (UTC)
Maintenance of source code
Please note that despite the original software source is gone, I have a software based on this and I maintain a fork of the code, which is now linked on the Wiki page. Despite having the "out-of-date" note, this software still 100% compatible with OSM data and works well. CeyX provides a very easy way to create PNG images (or tiles) from OSM data - assuming you have Python 2.x. If someone would consider updating this to Python 3, please help me. (Unfortunately the necessary GTK libraries are not ported to Python 3 as I understand.) Kempelen (talk) 10:45, 23 April 2022 (UTC)