Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I created my osm file in JOSM, and i imported it to my database by osm2pgsql tool. I created new layer in my osm.xml file, which selecting data with query:

select way from planet_osm_line,
(select parts from planet_osm_rels WHERE (((hstore(tags)->'level'))  = '0')) p
where osm_id = any (p.parts)) 

when i run my python script to generate png file i got an error:

RuntimeError: Postgis Plugin: PostGIS: unable to query the layer extent of table 'planet_osm_rels' because we cannot determine the geometry field name. Please provide either an 'extent' parameter to skip this query, a 'geometry_field' and/or 'geometry_table' parameter, or add a record to the 'geometry_columns' for your table.

is any one can tell me what i'm doing wrong and how i can fix that?

share|improve this question
Did you ever figure this out? I suspect it's to do with the -> operation (which I don't know about) because I get this error when using "SUBSTRING" in my query. –  milkypostman Jun 5 '12 at 17:34
i still didn't solve that, operation -> is in some extension to postgres (don't remember the name of it), hstore() change list to hashmap and operator -> returns value from hashmap with given key –  user902383 Jul 3 '12 at 8:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.