NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Heyho!

When trying to render my map from PostgreSQL/PostGIS database by generate_image.py and osm.xml I receive the following ERROR! Could somebody be so kind and try to solve my problem?

If you need to see some sourcecode etc. .. just tell me and I'll upload it here!

Thanks and Greetings! Matze


Traceback (most recent call last):
  File "C:\0A\9\run_python.py", line 3, in <module>
    execfile(r"C:\0A\9\generate_image.py")
  File "C:\0A\9\generate_image.py", line 42, in <module>
    mapnik.load_map(m,mapfile)
RuntimeError: Postgis Plugin: PSQL error:
ERROR:  column "generator:source" does not exist
LINE 8:          or (power='generator' and ("generator:source"='wind...
                                            ^
Full sql was: 'SELECT * FROM 
      (select *
      from planet_osm_point
      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 ("generator:source"='wind' or power_source='wind'))
         or "natural" in ('peak','volcano','spring','tree','cave_entrance')
         or railway='level_crossing'
      ) as symbols LIMIT 0'
 (encountered during parsing of layer 'amenity-symbols' in map 'osm.xml')

asked 28 Mar '12, 08:55

MHein's gravatar image

MHein
141111116
accept rate: 0%

edited 19 Mar '13, 10:27

SK53's gravatar image

SK53 ♦
28.1k48268433


This is likely because your osm2pgsql version is older than the osm.xml map style. The map style assumes that osm2pgsql has imported a column named generator:source but in fact osm2pgsql hasn't. You can fix the problem in one of these ways:

  • get new osm2pgsql (or just new default.style file) and do new import
  • get an older osm.xml map style that does not rely on generator:source
  • insert an empty generator:source column into your postgres tables
  • remove the line about power generators from your osm.xml

Obvoiusly, only the first option will lead to wind turbines being rendered properly.

permanent link

answered 28 Mar '12, 09:09

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

thanks! I'll try the first way and if it doesn't work, i'll ask again ;)

(28 Mar '12, 09:28) MHein

The software osm2pgsql, usually used to import OSM data into a rendering database, only imports a subset of the data required for rendering. What osm2pgsql deems necessary for rendering (and thus the resulting database schema) is defined in a import style-sheet. This osm2pgsql import style-sheet needs to match your mapnik rendering style-sheet, otherwise you will see errors as yours, complaining about missing columns.

Looking at your output, it appears you are using windows. The windows version of osm2pgsql is unfortunately very old and thus the import style-sheet going with it no longer matches the current osm mapnik style-sheet. You can find the current import style-sheet at https://trac.openstreetmap.org/browser/applications/utils/export/osm2pgsql/default.style which you will need for re-importing the data into your database.

permanent link

answered 28 Mar '12, 09:15

apmon's gravatar image

apmon
6.5k184456
accept rate: 20%

Who, this is probably my solution to! I don't have much experience with linux but I got pretty far. This is my error. But my question is how can I check the versions and find the right style-sheet?

My Error:

`renderd[17965]: An error occurred while loading the map layer 'default': :
ERROR:  column "generator:source" does not exist
LINE 8:          or (power='generator' and ("generator:source"='wind...
                                            ^
Full sql was: 'SELECT * FROM 
      (select *
      from planet_osm_point
      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 ("generator:source"='wind' or power_source='wind'))
         or "natural" in ('peak','volcano','spring','tree','cave_entrance')
         or railway='level_crossing'
      ) as symbols LIMIT 0'
 (encountered during parsing of layer 'amenity-symbols' in map '/home/administrator/src/mapnik-style/osm.xml')
renderd[17965]: An error occurred while loading the map layer 'default': :
ERROR:  column "generator:source" does not exist
LINE 8:          or (power='generator' and ("generator:source"='wind...
                                            ^
Full sql was: 'SELECT * FROM 
      (select *
      from planet_osm_point
      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 ("generator:source"='wind' or power_source='wind'))
         or "natural" in ('peak','volcano','spring','tree','cave_entrance')
         or railway='level_crossing'
      ) as symbols LIMIT 0'
 (encountered during parsing of layer 'amenity-symbols' in map '/home/administrator/src/mapnik-style/osm.xml')
renderd[17965]: An error occurred while loading the map layer 'default': :
ERROR:  column "generator:source" does not exist
LINE 8:          or (power='generator' and ("generator:source"='wind...
                                            ^
Full sql was: 'SELECT * FROM 
      (select *
      from planet_osm_point
      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 ("generator:source"='wind' or power_source='wind'))
         or "natural" in ('peak','volcano','spring','tree','cave_entrance')
         or railway='level_crossing'
      ) as symbols LIMIT 0'
 (encountered during parsing of layer 'amenity-symbols' in map '/home/administrator/src/mapnik-style/osm.xml')
renderd[17965]: An error occurred while loading the map layer 'default': :
ERROR:  column "generator:source" does not exist
LINE 8:          or (power='generator' and ("generator:source"='wind...
                                            ^
Full sql was: 'SELECT * FROM 
      (select *
      from planet_osm_point
      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 ("generator:source"='wind' or power_source='wind'))
         or "natural" in ('peak','volcano','spring','tree','cave_entrance')
         or railway='level_crossing'
      ) as symbols LIMIT 0'
 (encountered during parsing of layer 'amenity-symbols' in map '/home/administrator/src/mapnik-style/osm.xml')`
permanent link

answered 17 Mar '13, 22:28

gdonk's gravatar image

gdonk
111
accept rate: 0%

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×341
×293
×263
×8
×4

question asked: 28 Mar '12, 08:55

question was seen: 10,250 times

last updated: 19 Mar '13, 10:27

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum