[OSM-dev] FW: planet analysis

Andy Robinson Andy_J_Robinson at blueyonder.co.uk
Wed Jan 17 12:36:35 GMT 2007


Sorry, missed the list

Andy Robinson
Andy_J_Robinson at blueyonder.co.uk 

-----Original Message-----
From: Andy Robinson [mailto:Andy_J_Robinson at blueyonder.co.uk] 
Sent: 17 January 2007 12:36 PM
To: 'Robert (Jamie) Munro'
Subject: RE: [OSM-dev] planet analysis


>-----Original Message-----
>From: dev-bounces at openstreetmap.org [mailto:dev-bounces at openstreetmap.org]
>On Behalf Of Robert (Jamie) Munro
>Sent: 17 January 2007 12:07 PM
>To: dev at openstreetmap.org
>Subject: Re: [OSM-dev] planet analysis
>
>SteveC wrote:
>> I got asked, again, yesterday how many miles of road we have (in the
>> UK). Anyone want to write a script against the planet dump to figure it
>> out?
>
>What do you define as road? Does the script have to ignore footpaths and
>area features? Also does it have to detect dual carriageways and only
>count half of them?
>
>To do a total length of all segments, all you need is an sql query
>something like:
>
>select KM_TO_MI(sum(DISTANCE(a.Lon,a.Lat,b.Lon,b.Lat))
> from current_segments
> inner join current_nodes as a on a.id=current_segments.node_a
> inner join current_nodes as b on b.id=current_segments.node_b
>
>(with the DISTANCE and KM_TO_MI functions coming from
>http://empyrean.lib.ndsu.nodak.edu/~nem/mysql/udf/, which is the first
>library I found that does it).
>
>Robert (Jamie) Munro
>

There is no easy answer to this at the moment. If all the "highway=" ways
were tagged then we could use that to filter appropriately but they are not.
So what I would do is run the raw segment basis first then do some
additional queries to assess the likely percentage of way types and with
that info adjust the segment value to give a rough estimate. Its an hourly
moving set of goalposts anyway.

Cheers

Andy







More information about the dev mailing list