It's worth noting that the results will be in Mercator meters, not meters.

 

I have OSM loaded into a pgsnapshot db and can run queries on request.

 

Something else is that tags->'highway' in ( 'motorway', 'primary',
'secondary' ) will NOT use indexes on tags.

 

tags @> hstore('highway', 'motorway') OR tags @> hstore('highway',
'primary') OR tags @> hstore('highway', 'secondary') should be significantly
faster with proper indexes.

 

 

From: the Old Topo Depot [mailto:oldto...@novacell.com] 
Sent: Wednesday, December 05, 2012 9:06 AM
To: Richard Welty
Cc: talk-us@openstreetmap.org
Subject: Re: [Talk-us] tools for analysis of road networks?

 

Richard,

 

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.

select ST_length( ST_Transform( linestring, 900913 ) ), id, tags->'highway'
as htype, tags->'name' as name from ways where 

tags->'highway' in ( 'motorway', 'primary', 'secondary' )

AND bbox && ST_GeometryFromText( 'POLYGON(( -120 34, -119 34, -119 35, -120
35, -120 34 ))', 4326 )

 

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

 

HTH

 

On Wed, Dec 5, 2012 at 7:14 AM, Richard Welty <rwe...@averillpark.net>
wrote:

On 12/5/12 10:04 AM, Frederik Ramm wrote:

Hi,

On 12/05/2012 03:55 PM, Richard Welty wrote:

i'm looking at a need to do some analysis & estimation based on road nets
extracted from OSM; the goal is to be able to estimate things like time to
complete ground surveys (e.g., TIGER review and collection of hydrant
locations.)

are there any libraries or tools kicking around that folks might have
developed and would be willing to share?


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.

thanks, that could be a big help. whatever i develop, i expect to have to
work out
away to distinguish between urban/suburban/rural networks as there is a
distinct
difference in time to survey, although right now i am reluctant to
characterize how
much it really is.

richard




_______________________________________________
Talk-us mailing list
Talk-us@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk-us





 

-- 
John Novak
585-OLD-TOPOS (585-653-8676)

_______________________________________________
Talk-us mailing list
Talk-us@openstreetmap.org
http://lists.openstreetmap.org/listinfo/talk-us

Reply via email to