0

YQL, geo.places, and boundingBox

I have a GPS coordinate (latitude, longitude) and I'd like to execute a query that returns the corresponding county from geo.places

I want to use the geo.places.boundingBox fields in my query. Is this possible? Do I need to use a local query instead of a remote query?

I tried this query but it did not work:

select postal, woeid,name from geo.places
where ( geo.places.boundingBox.southWest.latitude <= 45.521694 AND geo.places.boundingBox.northEast.latitude >= 45.521694 ) AND ( geo.places.boundingBox.southWest.longitude <= -122.691806 AND geo.places.boundingBox.northEast.longitude <= -122.691806 ) and geo.places.placeType = 9


Is there an easier / more efficient way to find matches for a given lat/long pair?

by
1 Reply
  • QUOTE (sspdx @ Nov 28 2008, 04:07 PM) <{POST_SNAPBACK}>
    I have a GPS coordinate (latitude, longitude) and I'd like to execute a query that returns the corresponding county from geo.places

    I want to use the geo.places.boundingBox fields in my query. Is this possible? Do I need to use a local query instead of a remote query?

    I tried this query but it did not work:

    select postal, woeid,name from geo.places
    where ( geo.places.boundingBox.southWest.latitude <= 45.521694 AND geo.places.boundingBox.northEast.latitude >= 45.521694 ) AND ( geo.places.boundingBox.southWest.longitude <= -122.691806 AND geo.places.boundingBox.northEast.longitude <= -122.691806 ) and geo.places.placeType = 9


    Is there an easier / more efficient way to find matches for a given lat/long pair?


    That query is filtering the results once they start coming back from the geo table - not getting the results at that bounding box (so you are doing "local" filtering but not getting the data you need). The geo service today doesn't provide the type of functionality you're after. I'm going to look into this some more.

    Jonathan
    0

Recent Posts

in YQL