0

Using relationships for search

Thanks for the cool API, I've found the Geo API to be very interesting. One feature that I'd like to see is the ability to use relationships in /places filtering. Ideally all of the relationships could be used to construct a filter, but the parent/children relationships would be particular useful. For example:

To get info about ILI'ILI that is within American Samoa:

CODE
http://where.yahooapis.com/v1/places.q(ILI'ILI).parent(American Samoa)

Or to get info about the Milwaukee that has County Stadium as a child:

CODE
http://where.yahooapis.com/v1/places.q(Milwaukee).children(County Stadium)


Thanks,
-Brad

by
1 Reply
  • You should be able to accomplish your first example by appending the parent (or ancestor) name to the child name in the .q filter. Unfortunately, we don't have the village of Ili'ili in our named place repository. Here is an example for Futiga in American Samoa:

    CODE
    http://where.yahooapis.com/v1/places.q(Futiga American Samoa)


    Regarding your second example, you could first find the POI (point of interest) you know (Milwaukee County Stadium), and then find its town from its collection of ancestors, like so:

    CODE
    http://where.yahooapis.com/v1/places.q(Milwaukee County Stadium)?select=short
    returns a result for Miller Park (the stadium that replaced County Stadium) with WOEID 23674699.

    CODE
    http://where.yahooapis.com/v1/place/23674699/ancestors?select=long
    returns a result for Milwaukee (town).

    Note that we do not always support generic names (such as Stadium, Municipal Statium, County Stadium) for POIs as they could apply to many named places. Qualifying such names will provide better results.

    We will consider your enhancement request for a possible future release.

    Eddie Babcock
    Yahoo! Geo Technologies

    QUOTE (Brad Schick @ Feb 14 2009, 02:07 AM) <{POST_SNAPBACK}>
    Thanks for the cool API, I've found the Geo API to be very interesting. One feature that I'd like to see is the ability to use relationships in /places filtering. Ideally all of the relationships could be used to construct a filter, but the parent/children relationships would be particular useful. For example:

    To get info about ILI'ILI that is within American Samoa:

    CODE
    http://where.yahooapis.com/v1/places.q(ILI'ILI).parent(American Samoa)

    Or to get info about the Milwaukee that has County Stadium as a child:

    CODE
    http://where.yahooapis.com/v1/places.q(Milwaukee).children(County Stadium)


    Thanks,
    -Brad
    0
This forum is locked.

Recent Posts

in GeoPlanet Enhancement Requests