<div dir="ltr"><div class="gmail_signature"><br></div><div class="gmail_signature">Hello,</div><div class="gmail_signature"><br></div><div class="gmail_signature">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.</div><div class="gmail_signature"><br></div><div class="gmail_signature">I got a sense from the <a href="http://wiki.openstreetmap.org/wiki/Component_overview">component overview</a> that data should be imported into a PostGIS data for quick querying. So as of now, I have managed to<br></div><div class="gmail_signature"><br></div><div class="gmail_signature">1. Download bulk data from OSM using API (This is a small region)</div><div class="gmail_signature">2. Setup Postgres with PostGIS extension.</div><div class="gmail_signature">3. Import data into PostGIS database using osm2pgsql</div><div class="gmail_signature"><br></div><div class="gmail_signature">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.</div><div class="gmail_signature"><br></div><div class="gmail_signature">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.</div><div class="gmail_signature"><br></div><div class="gmail_signature">I recently also stumbled upon the <a href="http://wiki.openstreetmap.org/wiki/Overpass_API">Overpass API</a> 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.</div><div class="gmail_signature"><br></div><div class="gmail_signature">Any help is really appreciated. Thanks a lot for your help and OSM!</div><div class="gmail_signature"><br></div><div class="gmail_signature">Best,</div><div class="gmail_signature">Pulkit</div><div class="gmail_signature"><br></div>
</div>