Hello everyone! Well, I tried this code in other computer and it worked just fine. I changed the line: lyr.datasource = mapnik.Shapefile(base=filepath, file=filepath) for lyr.datasource = mapnik.Shapefile(base=ruta,file=archivo[0]) I also did hard coding to test my script: lyr.datasource = mapnik.Shapefile(file='C:\\Python26\\tapalpa_05_plani_line') It also worked as well!!
But when I run the module in my computer it throws many errors, if I use lyr.datasource = mapnik.Shapefile(base=ruta,file=archivo[0]), it shows Python Runtime Error: wrong file code: -1991225785 2011/5/19 Brad Posthumus <mcgo...@yahoo.com> > > > > Susana Iraiis Delgado Rodriguez wrote: > > > > Hello Alan!! > > Can you please tell me, how to rebuild my path? I've tried it, but I > > didn't > > succed =( > > > > > > The doctest for the Shapefile function includes this line: > > >>> shp = Shapefile(base='/home/mapnik/data',file='world_borders') > > This tells you "base" is a path, and "file" is your shapefile. > > In your code below, you're using the full path of the shapefile for both > parameters. Fortunately, your code already seems to provide both required > inputs. Try changing this line: > > lyr.datasource = mapnik.Shapefile(base=filepath, file=filepath) > > ...to: > > lyr.datasource = mapnik.Shapefile(base=ruta, file=filename) > > --------------- > Brad Posthumus > > -- > View this message in context: > http://old.nabble.com/-Tutor--RuntimeError%3A-file-does-not-exist-tp31640074p31655637.html > Sent from the Python - tutor mailing list archive at Nabble.com. > > _______________________________________________ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor >
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor