Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way to extract a single row out of the OSM-GIS-Database (by a Query)? It would be so much easier if I could find an EER Model of the Database.

I was searching a long term and found very less information about that. So I think it would be the best to ask the pros before thinking it's impossible.

share|improve this question
Welcome to GIS SE! Did you load the OSM data to a Postgresql/PostGIS database? – R.K. Nov 27 '12 at 11:59
Yes I exactly did this. I also use these data as a base for a tile service – Bernhard Nov 27 '12 at 12:37
Which importing tool did you use? – U2ros Nov 27 '12 at 13:18
OSM2PSQL Was used for importing – Bernhard Nov 27 '12 at 14:01
OSM2PSQL we used for importing. It created a Database with about 9 Tables (geometry_columns, planet_osm_line, planet_osm_nodes, planet_osm_point, planet_osm_polygon, planet_osm_rels, planet_osm_roads, planet_osm_ways, spatial_ref_sys) – Bernhard Nov 27 '12 at 14:03

The basic format is the same as any SQL query: select [fields] from [table] where [query]

Here's an example from the osm2pgsql schema page: select name, place, ST_XMin(way), ST_YMin(way) from planet_osm_point where place='city' order by name The schema page should also help you understand the different tables.

But maybe there's something more complicated you're trying to do? If so, please expand on your question.

share|improve this answer
That didn't helped me because i need a full road to overlay it on a map (for interactive functionality) – Bernhard Nov 28 '12 at 13:01
So that should be in planet_osm_line or planet_osm_roads. Can you get the road by osm ID, or by using the tags (like name or ref)? Or are you wanting to use a spatial query? – neuhausr Nov 28 '12 at 14:58

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.