[OSM-dev] Cannot render tiles using Mapnik: "Bad file descriptor"

Udo Giacomozzi udo.osm at nova-sys.net
Tue Mar 17 10:34:59 GMT 2009


I just set up Mapnik on a Debian Etch machine by following the
instructions in the Wiki. For a first test I downloaded only a small
area from openstreetmap.org:
http://www.openstreetmap.org/?lat=46.2967&lon=11.2565&zoom=12&layers=B000FFF

Setting up the database seemed to finish without any problems.

When running generate_tiles.py I get the following error:

----------------------------------------------------------------8<-----

~/osm-data/mapnik$ ./generate_tiles.py
render_tiles( (11.128, 46.2136, 11.3849, 46.3797) /home/maptiles/mapnik/osm.xml /home/maptiles/mapnik/tiles/ 1 12 Suedtirol )
 got exception ...
Traceback (most recent call last):
  File "./generate_tiles.py", line 135, in ?
    render_tiles(bbox, mapfile, tile_dir, 1, 12 , "Suedtirol")
  File "./generate_tiles.py", line 53, in render_tiles
    load_map(m,mapfile)
RuntimeError: failed opening file: Bad file descriptor

----------------------------------------------------------------8<-----


I have no experiences with Python, but I guess it's failing to open
the osm.xml file for some strange reason. However, the file exists:
  

----------------------------------------------------------------8<-----
~/osm-data/mapnik$ ls -al /home/maptiles/mapnik/osm.xml
-rw-r--r-- 1 maptiles users 318204 2009-03-17 11:01 /home/maptiles/mapnik/osm.xml
----------------------------------------------------------------8<-----



My environment setup script:
http://paste.debian.net/30752/

My modified Python script to only render the specified area:
http://paste.debian.net/30753/


The unmodified generate_tiles.py script (which I guess tries to render
the whole world) produced the same error. Also, it's not clear to me
why there are so many bounding boxes for german cities activated by
default.

I'm using symbolic links for the data files, is that a problem?

----------------------------------------------------------------8<-----
~/osm-data/mapnik$ ls -al ~/mapnik/
total 328
drwxr-xr-x 3 maptiles users   4096 2009-03-17 11:01 .
drwxr-xr-x 8 maptiles users   4096 2009-03-17 10:57 ..
-rw-r--r-- 1 maptiles users 318204 2009-03-17 11:01 osm.xml
lrwxrwxrwx 1 maptiles users     38 2009-03-17 11:00 symbols -> /home/maptiles/osm-data/mapnik/symbols
drwxr-xr-x 2 maptiles users   4096 2009-03-17 10:59 tiles
lrwxrwxrwx 1 maptiles users     40 2009-03-17 11:00 world_boundaries -> /home/maptiles/osm-data/world_boundaries
----------------------------------------------------------------8<-----

Of course I double checked that the links are valid.


Any hints?


Udo







More information about the dev mailing list