This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Given a set of GPS coordinates, how do I find the closest freeway name?

1

I have been given 100's of GPS coordinates for points along the freeway. These points are actually freeway exit GPS coordinates. I need to run a query that just provides the name of the freeway or highway closest to the coordinates. I will than parse this data into Excel where I can display the name. I have the Excel portion resolved, I just need to reduce the query to just the closest freeway. I am new to this type of query so I really need some help.

If nothing else just provide a query so I can get the closest freeway!

Sample Data

PRIMM                       1       35.612419   -115.389038 
SR161-JEAN-GOODSPRINGS      1       35.780735   -115.328254 
SLOAN                       0       35.930599   -115.193115 
HENDERSON-LAKE MEAD         0       35.961925   -115.18177
SEACHLIGHT-NEEDLES          1       35.967418   -114.894599

Sample Query: http://nominatim.openstreetmap.org/reverse?format=xml&lat=35.612419%20&lon=-115.389038&zoom=18&addressdetails=1

XML Output:

<reversegeocode timestamp="Mon, 05 Aug 13 22:08:40 +0000" attribution="Data © OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright" querystring="format=xml&lat=35.612419%20&lon=-115.389038&zoom=18&addressdetails=1">
    <result place_id="5999235837" osm_type="way" osm_id="148728272" ref="East Primm Boulevard" lat="35.6125513" lon="-115.3843467">
    East Primm Boulevard, Primm, Clark, Nevada, United States of America
    </result>
    <addressparts>
    <road>East Primm Boulevard</road>
    <village>Primm</village>
    <county>Clark</county>
    <state>Nevada</state>
    <country>United States of America</country>
    <country_code>us</country_code>
    </addressparts>
    </reversegeocode>

asked 05 Aug '13, 23:13

israellopez215's gravatar image

israellopez215
26113
accept rate: 0%

edited 25 Nov '13, 15:40

aseerel4c26's gravatar image

aseerel4c26 ♦
32.6k18248554

Source code available on GitHub .