[OSM-newbies] Howto: Query to get max speed limit of nearby road/highway

John F. Eldredge john at jfeldredge.com
Fri Aug 24 18:38:05 BST 2012


"René Fournier" <m5 at renefournier.com> wrote:

> So... I've imported 27 GB of canada.osm into PostGIS 1.5.4. Now I am
> trying to construct a query that, given a point (latitude, longitude),
> finds the max speed limit of the road it is on (or within 10 meters of
> — otherwise, return nothing). Can anyone help? I'm a total OSM noob,
> and have no idea how the data is structured or how best to extract
> this one piece of information. Thanks!
> 
> ....Rene
> _______________________________________________
> newbies mailing list
> newbies at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/newbies

How do you plan to handle the situation where more than one road is within the 10-meter radius, and the roads have different maximum speed limit values?  This is likely to be a common occurrence if you are near or at the intersection of a major road and a residential side-street.  I assume the 10-meter radius is to allow for GPS error.

-- 
John F. Eldredge --  john at jfeldredge.com
"Reserve your right to think, for even to think wrongly is better than not to think at all." -- Hypatia of Alexandria



More information about the newbies mailing list