On Sat, 13 Nov 2010 20:47:54 +0100, yvecai wrote: > I am modifying an XML file dynamically in python as a string, and I load > the file with mapnik.load_map_from_string(...). Then, I would like to > change the datasource. > > mapnik.load_map_from_string(m,mapfile) > for l in m.layers: > l.datasource = Osm(file='element2.osm') > save_map(m,'mapfile.xml') > > The mapfile.xml take into account my new datasource 'element2.osm', but > mapnik.render(m, im) will render with my previous datasource (which is > called 'element.osm'. > The datasource is changed, but not taken into account. Any idea?
Why don't you load the map again after changing the datasource? David -- . ''`. Debian developer | http://wiki.debian.org/DavidPaleino : :' : Linuxer #334216 --|-- http://www.hanskalabs.net/ `. `'` GPG: 1392B174 ----|---- http://deb.li/dapal `- 2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
signature.asc
Description: PGP signature
_______________________________________________ Mapnik-users mailing list [email protected] https://lists.berlios.de/mailman/listinfo/mapnik-users

