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.

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.

Thanks in advance

Bernhard

share|improve this question
1  
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

1 Answer 1

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

 
discard

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.