Issue with generate_titles.py

Topics: Algorithms
May 21, 2013 at 5:29 PM
First of all,
a great thank you to the person who will help me with it.

I have my own PostGres/Postgit server, after that I used a python scrip "generate_titles.py" to generates my tiles.

I'm able to generate a couple of tiles, but eventually "generate_titles.py" crash.

I don't think I am that far, I was able to use "generate_image.py" and get this.

The command:
C:\ >generate_tiles_boston.py
The result:
render_tiles( (-71.200000000000003, 42.229999999999997, -70.989999999999995, 42.399999999999999)
/osm_boston_tiles/ma_osm.xml /osm_boston_tiles/ 10 17 Boston )
Boston : 10 310 378
Exception in thread Thread-2:
Traceback (most recent call last):
  File "C:\Python26\lib\threading.py", line 522, in __bootstrap_inner
    self.run()
  File "C:\Python26\lib\threading.py", line 477, in run
    self.__target(*self.__args, **self.__kwargs)
  File "C:\Users\vincentberube\Documents\EIDF\Settup\osm_mapnik\generate_tiles_boston.py", line 110, in loop
    self.render_tile(tile_uri, x, y, z)
  File "C:\Users\vincentberube\Documents\EIDF\Settup\osm_mapnik\generate_tiles_boston.py", line 92, in render_tile
    mapnik.render(self.m, im)
RuntimeError: PSQL error
Full sql was: 'SELECT AsBinary("way") AS geom,"aeroway","name" from
      (select *
      from planet_osm_polygon
      where aeroway in ('airport','aerodrome','helipad')
         or barrier in ('bollard','gate','lift_gate','block')
         or highway in ('mini_roundabout','gate')
         or man_made in ('lighthouse','power_wind','windmill','mast')
         or (power='generator' and power_source='wind')
         or "natural" in ('peak','volcano','spring','tree')
         or railway='level_crossing'
      ) as symbols WHERE "way" && SetSRID('BOX3D(-7964126.851089085 5146352.240384348,-7885855.334125063 5224623.75734837)'::box3d, 900913)'


Boston : 10 310 379
column number 3 is out of range 0..2
column number 3 is out of range 0..2
message type 0x31 arrived from server while idle
message type 0x32 arrived from server while idle
message type 0x54 arrived from server while idle
message type 0x43 arrived from server while idle
message type 0x5a arrived from server while idle
message type 0x31 arrived from server while idle
message type 0x32 arrived from server while idle
message type 0x54 arrived from server while idle
message type 0x44 arrived from server while idle
message type 0x44 arrived from server while idle
message type 0x44 arrived from server while idle
column number 2 is out of range 0..1
Coordinator
May 21, 2013 at 7:48 PM
  • Is the script always stopping at the same "tile"?
  • Have you tried the stated sql against the database using psql or pgadminIII, what does it say, maybe you are missing data?
Hth FObermaier
May 21, 2013 at 8:21 PM
Edited May 21, 2013 at 8:37 PM
Hi FObermaier,
If you have read my previous answer, I have edited it.

It never crash at the same place, everytime I execute again, it will downloads more tiles and crash.

When it crash, I execute the query that I see in the cmd windows in psql, and the result is 0.

Do you have any idea? By the way, I use mapnik.
Traceback (most recent call last):
  File "C:\Python26\lib\threading.py", line 522, in __bootstrap_inner
    self.run()
  File "C:\Python26\lib\threading.py", line 477, in run
    self.__target(*self.__args, **self.__kwargs)
  File "C:\Users\generate_tiles_ma.py", line 110, in loop
    self.render_tile(tile_uri, x, y, z)
  File "C:\Users\generate_tiles_ma.py", line 92, in render_tile
    mapnik.render(self.m, im)
RuntimeError: PSQL error:
message contents do not agree with length in message type "D"
lost synchronization with server: got message type "e", length 1818849391
lost synchronization with server: got message type "e", length 1818849391
Full sql was: 'SELECT AsBinary("way") AS geom,"name","place" from
      (select way,place,name
      from planet_osm_point
      where place in ('city','metropolis','town','large_town','small_town')
        and (capital is null or capital != 'yes')
      ) as placenames WHERE "way" && SetSRID('BOX3D(-8042398.368053104 5185487.998866359,-7964126.851089084 5263759.515830377)'::box3d, 900913)'
Coordinator
May 21, 2013 at 9:10 PM
Googling around, there seems to be a threading issue with the generate_tiles.py script. So either somehow you set the number of threads used to just one or you give this script a chance.

Hth FObermaier