Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

For an app I'm developing, I want to use the phone's GPS to locate it. I then want it to list streets that are nearby. The customer might be in his back garden for example, and this may be closer to another street, but not be the street he actually lives on.

I am thinking, I can ask the API several times and skew the coordinates slightly in each request. But that might be expensive in money and time.

Is there an API that can do such a thing in one request?

share|improve this question
1  
You're actually looking for a service that does that? Online? –  lynxlynxlynx Jun 11 '12 at 12:38
    
Yes, if it exists. Is there another approach I can take? All I'm concerned about is that the user can correct the suggested street by selecting from a list, instead of having to key it in. –  Jepper Jun 11 '12 at 12:59
add comment

3 Answers 3

You can send the Phone's GPS position to Yahoo Place Finder (API) request

http://where.yahooapis.com/geocode?location=37.787082+-122.400929&gflags=R&appid=yourappid

lat/lng=37.787082,-122.400929 (GPS cords)

<?xml version="1.0" encoding="UTF-8"?>  
<ResultSet version="1.0">  
  <Error>0</Error>  
  <ErrorMessage>No error</ErrorMessage>  
  <Locale>us_US</Locale>  
  <Quality>99</Quality>  
  <Found>1</Found>  
  <Result>  
    <quality>99</quality>  
    <latitude>37.787082</latitude>  
    <longitude>-122.400929</longitude>  
    <offsetlat>37.787082</offsetlat>  
    <offsetlon>-122.400929</offsetlon>  
    <radius>500</radius>  
    <name>37.787082 -122.400929</name>  
    <line1>655 Mission St</line1>  
    <line2>San Francisco, CA  94105-4126</line2>  
    <line3/>  
    <line4>United States</line4>  
    <house>655</house>  
    <street>Mission St</street>  
    <xstreet/>  
    <unittype/>  
    <unit/>  
    <postal>94105-4126</postal>  
    <neighborhood/>  
    <city>San Francisco</city>  
    <county>San Francisco County</county>  
    <state>California</state>  
    <country>United States</country>  
    <countrycode>US</countrycode>  
    <statecode>CA</statecode>  
    <countycode/>  
    <hash/>  
    <woeid>12797156</woeid>  
    <woetype>11</woetype>  
    <uzip>94105</uzip>  
  </Result>  
</ResultSet>  

Extract your street from this response.

share|improve this answer
    
This will give you the single nearest street. I think the OP wants to find a list (or range) or nearby streets. Can PlaceFinder do that? –  Jeffrey Jun 11 '12 at 22:22
    
With the Bounding Box option flag - yes "Defines the extent of a box that encloses an area. Returned if P flag is not set and X flag is set." –  Mapperz Jun 12 '12 at 13:23
add comment

What you're looking for is a service that can offer reverse-geocoding to get an approximate street address location and then using the ZIP+4 street data, determine the surrounding streets. Google offers a reverse-geocoding API. From there, you can use the street data (with geo-coordinates) from the US Census Bureau TIGER data to determine proximity.

You will need to determine your definition of "close". Do you want all the streets within a certain radius – rural addresses may fail in this case – or do you want to just list the first 10 streets regardless of distance away from the location? Remember, that the TIGER data gives a start and stop point for each street based on the intersections so there may be a street that is closer to the destination but might be incorrectly displayed as further away if the end points are not very proximate to the location. In that case, perhaps you could first determine the median centerpoint coordinates for each street within a larger subset and use that to determine proximity.

With that said, I have also not seen a service exactly like what you are seeking. I work at an address verification company called SmartyStreets and we are working on something that does this with our API but it's not finished yet so don't tell anyone.

Wait, is this forum public? D'oh! (It's just not done yet so I can't show you anything yet.)

share|improve this answer
    
I'll keep your secret under tight cover :) Good points - the best I can say is that it should return no more than 5-6 streets in urban settings - or what can fit in a smartphone display along with a small map. Within a radius is probably the best option, meaning rural areas should yield only one street. –  Jepper Jun 12 '12 at 7:41
add comment

I am not aware of any and if there really isn't one, you're left with creating a thin intermediate service to externalise the extra calls. You'd pass it the coordinates like usually and it would return the nearest few streets. Either by calling standard services multiple times with slightly shifted coordinates (like you mentioned) or by doing a nicer spatial query - checking for intersections between vector street data and a fixed buffer around the passed coordinates. You probably don't have all the required data for the latter though, since OSM coverage is partial.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.