<div dir="ltr"><div>Hello Christian:<br><br></div>Thank you for answering my question. This is definitely extremely helpful. <br><div><div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 30, 2014 at 1:29 PM, Christian Quest <span dir="ltr"><<a href="mailto:cquest@openstreetmap.fr" target="_blank">cquest@openstreetmap.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><br><div class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">The PostGIS in Action book has an interesting example of query:<br>
"Suppose the task at hand is to find the total length of all interstate highways in the state of Utah. We search for two tables: one with the polygons for all the states and one with all interstate highways in the United States, represented as linestrings. Next we extract the polygon that represents Utah from the states table and perform an SQL join with the highways table using<br>
the geometric intersects function as the join operator and geometric intersection as<br>our output function. The output of that query would be those portions of all highways<br>within the state of Utah."<br><br>Is such a query doable with the postgis database generated by osm2pgsql?</div>
</blockquote><div><br></div></div><div>Yes</div><div><br></div><div>It is not designed for that, but I regularly use it that way.</div><div>Be aware that osm2pgsql does not keep all OSM data and tags. This is controlled by the style file (or style LUA script) during import.</div>
<div>Be aware also of the map projection. By default osm2pgsql will reproject OSM lat/lon into web mercator coordinates. Doing real distance based queries will require reprojection...</div><div class=""><div><br></div></div>
</div></div></div></blockquote><div><br><br></div><div>When you say that osm2pgsql will reproject OSM lat/lon into web mercator, and that real distance calculation will require reprojection, do you actually mean re-importing the data in a different manner in the database, or is there a way to do the conversion on the fly with a query or using custom client code?<br>
<br><br><br></div><div><font color="#888888">Again, thank you for all your help!<br></font></div></div></div></div></div></div>