[Tutor] RuntimeError: file does not exist

Brad Posthumus mcgooly at yahoo.com
Thu May 19 14:53:00 CEST 2011




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.



More information about the Tutor mailing list