<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.hoenzb
{mso-style-name:hoenzb;}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>It’s worth noting that the results will be in Mercator meters, not meters.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I have OSM loaded into a pgsnapshot db and can run queries on request.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Something else is that tags->'highway' in ( 'motorway', 'primary', 'secondary' ) will NOT use indexes on tags.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>tags @> hstore('highway', 'motorway') OR tags @> hstore('highway', 'primary') OR tags @> hstore('highway', 'secondary') should be significantly faster with proper indexes.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> the Old Topo Depot [mailto:oldtopos@novacell.com] <br><b>Sent:</b> Wednesday, December 05, 2012 9:06 AM<br><b>To:</b> Richard Welty<br><b>Cc:</b> talk-us@openstreetmap.org<br><b>Subject:</b> Re: [Talk-us] tools for analysis of road networks?<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Richard,<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'>If the data you're using is in PostGIS ST_Length will give you the length of all the ways of interest within a bounding box, and, if you reproject to EPSG:900913 before calling the function you'll get the results in meters.<o:p></o:p></p><div><p class=MsoNormal>select ST_length( ST_Transform( linestring, 900913 ) ), id, tags->'highway' as htype, tags->'name' as name from ways where <o:p></o:p></p></div><div><p class=MsoNormal>tags->'highway' in ( 'motorway', 'primary', 'secondary' )<o:p></o:p></p></div><div><p class=MsoNormal>AND bbox && ST_GeometryFromText( 'POLYGON(( -120 34, -119 34, -119 35, -120 35, -120 34 ))', 4326 )<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>If helpful and you have a bounding box of interest I have an up to date planet file I can run the query on and send you results<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>HTH<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>On Wed, Dec 5, 2012 at 7:14 AM, Richard Welty <<a href="mailto:rwelty@averillpark.net" target="_blank">rwelty@averillpark.net</a>> wrote:<o:p></o:p></p><div><p class=MsoNormal>On 12/5/12 10:04 AM, Frederik Ramm wrote:<o:p></o:p></p><p class=MsoNormal>Hi,<br><br>On 12/05/2012 03:55 PM, Richard Welty wrote:<o:p></o:p></p><p class=MsoNormal>i'm looking at a need to do some analysis & estimation based on road nets<br>extracted from OSM; the goal is to be able to estimate things like time to<br>complete ground surveys (e.g., TIGER review and collection of hydrant<br>locations.)<br><br>are there any libraries or tools kicking around that folks might have<br>developed and would be willing to share?<o:p></o:p></p><p class=MsoNormal><br>Not a big help but there's a tool in SVN called osm-length that will report how many metres of each highway type there are in any given OSM XML file. Could be a start.<o:p></o:p></p></div><p class=MsoNormal>thanks, that could be a big help. whatever i develop, i expect to have to work out<br>away to distinguish between urban/suburban/rural networks as there is a distinct<br>difference in time to survey, although right now i am reluctant to characterize how<br>much it really is.<span style='color:#888888'><br><br><span class=hoenzb>richard</span></span><o:p></o:p></p><div><div><p class=MsoNormal><br><br><br>_______________________________________________<br>Talk-us mailing list<br><a href="mailto:Talk-us@openstreetmap.org" target="_blank">Talk-us@openstreetmap.org</a><br><a href="http://lists.openstreetmap.org/listinfo/talk-us" target="_blank">http://lists.openstreetmap.org/listinfo/talk-us</a><o:p></o:p></p></div></div></div><p class=MsoNormal><br><br clear=all><o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><p class=MsoNormal style='margin-bottom:12.0pt'>-- <br>John Novak<br>585-OLD-TOPOS (585-653-8676)<o:p></o:p></p></div></div></div></body></html>