[OSM-dev] Querying OSM data for a region

Pulkit Bhuwalka pulkit.bosco05 at gmail.com
Sun Nov 9 23:46:01 UTC 2014


Hello,

My goal is to create my own local database of OSM data and use it for fast
querying (no writes) - so that I can ask things like "give me all the roads
within a small bounding box" etc.

I got a sense from the component overview
<http://wiki.openstreetmap.org/wiki/Component_overview> that data should be
imported into a PostGIS data for quick querying. So as of now, I have
managed to

1. Download bulk data from OSM using API (This is a small region)
2. Setup Postgres with PostGIS extension.
3. Import data into PostGIS database using osm2pgsql

I am not sure about the next step. What api should I use to query the
database? I suppose there exists some data access API which Mapnik and
other services use for drawing.

Also, I don't quite understand the DB structure and the data encoding
within it. There are a few tables created by PostGIS (spatial_ref_sys etc.)
and a few tables created by OSM (planet_osm_*). I am unsure about the
relation between these tables.

I recently also stumbled upon the Overpass API
<http://wiki.openstreetmap.org/wiki/Overpass_API> which seems to do
something similar. My requirements are actually pretty simple. I need some
simple querying to experiment with some rendering of my own.

Any help is really appreciated. Thanks a lot for your help and OSM!

Best,
Pulkit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20141109/eb825a9d/attachment.html>


More information about the dev mailing list