0

Suburb (22) from Geocode request confusion

OK, let's start from the start. I want to get from a geocoded address to the WOE id of the neighbourhood it is a part of. So, first step is the geocoding:

http://where.yahooapis.com/geocode?flags=G...20E%2042nd%20St

This returns the following suburbs:

<level4>Tudor City|East Side|Manhattan</level4>

However, it gives me a WOE id of 12761348, which is the zipcode in which the address resides:

http://isithackday.com/geoplanet-explorer/...?woeid=12761348

Now, in this case, the suburb is a child of this zip. However, that isn't always the case. Sometimes the suburb is a 'belongsto'. Sometimes it isn't related to the zip code at all. Does anyone know of a foolproof way of always getting the suburb WOE id from a geocode?

by
1 Reply
  • QUOTE (untogethered @ Jan 12 2011, 07:34 PM) <{POST_SNAPBACK}>
    OK, let's start from the start. I want to get from a geocoded address to the WOE id of the neighbourhood it is a part of. So, first step is the geocoding:

    http://where.yahooapis.com/geocode?flags=G...20E%2042nd%20St

    This returns the following suburbs:

    <level4>Tudor City|East Side|Manhattan</level4>

    However, it gives me a WOE id of 12761348, which is the zipcode in which the address resides:

    http://isithackday.com/geoplanet-explorer/...?woeid=12761348

    Now, in this case, the suburb is a child of this zip. However, that isn't always the case. Sometimes the suburb is a 'belongsto'. Sometimes it isn't related to the zip code at all. Does anyone know of a foolproof way of always getting the suburb WOE id from a geocode?


    PlaceFinder always returns the WOEID of the zip code associated with a street address; this zip code WOEID is not useful for determining the neighborhood WOEID. Neighborhoods (also called Suburbs) are informal areas within cities and are often not aligned with zip code area boundaries. Sometimes a small neighborhood will be fully contained in a single zip code area; sometimes a large neighborhood will contain multiple zip code areas; sometimes a neighborhood and zip code area will overlap.

    The way to solve this problem is to use the neighborhood name(s) returned by PlaceFinder. If you construct a query string using the first neighborhood name, city name, and state name or code (separated by spaces), and then pass this query string to GeoPlanet, it will return the WOEID for that neighborhood. For your example, the first neighborhood is "Tudor City", the city name is "New York", and the state code is "NY". This information can be used to create a query string "Tudor City New York NY". When this query string is passed to GeoPlanet (see below), the WOEID 23511898 (Tudor City) will be returned.

    CODE
    http://where.yahooapis.com/v1/places(Tudor+City+New+York+NY)?appid=


    Eddie Babcock
    Yahoo! Geo Technologies
    0
This forum is locked.

Recent Posts

in GeoPlanet General Discussion