<div dir="ltr"><br><div>Got it. Thanks a lot!</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 10, 2014 at 1:41 AM, Paul Norman <span dir="ltr"><<a href="mailto:penorman@mac.com" target="_blank">penorman@mac.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">The database you have created is a PostgreSQL database, and there are libraries in most languages for connecting to one.<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Sorry I wasn't clear. I understand that I can use a PostgreSQL driver from any language. I was wondering if there is an OpenStreetMap library/API which provides data access to the database. For instance where I can run queries like "return all nodes with a tag within a geometric bound". I thought there might be one since Mapnik and other services might need similar data access APIs.<br>
</blockquote></span>
You do this from within the standard PostgreSQL drivers. Additionally, after the data has been processed by osm2pgsql, you no longer need to use OSM-specific software, but can use non-OSM tools like Mapnik, QGIS, or anything that interacts with a PostGIS database.<br>
<br>
<a href="https://github.com/openstreetmap/osm2pgsql/blob/master/docs/analysis.md" target="_blank">https://github.com/<u></u>openstreetmap/osm2pgsql/blob/<u></u>master/docs/analysis.md</a> might help with writing some queries. It focuses more on queries for analysis, but should get you started.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Ok. So all roads and streets should be available in planet_osm_lines and planet_osm_polygons with "highway"/"landuse" or some similar column on. Is there a document which explains these? I want to use the data to 3D render roads, so probably I might need to use planet_osm_roads.<br>
</blockquote>
<br></span>
Depending on the classification of roads, you might not find the data in the roads table, but it will be in the line table.<div class="HOEnZb"><div class="h5"><br>
<br>
______________________________<u></u>_________________<br>
dev mailing list<br>
<a href="mailto:dev@openstreetmap.org" target="_blank">dev@openstreetmap.org</a><br>
<a href="https://lists.openstreetmap.org/listinfo/dev" target="_blank">https://lists.openstreetmap.<u></u>org/listinfo/dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Pulkit<br><br></div>
</div>