0

WOEID for city by coordinates

Hello,

I am trying to retrieve a WOEID by coordinates of a specific location, but sometimes it gives me the country's WOEID and not the city's. How can I get always the most accurate WOEID?

by
2 Replies
  • One way to get is this YQL query. But all woeid does not give you weather info so you might have to filter

    select * from geo.placefinder where text="25.946314,83.534546" and gflags="R"
    



    output

    {
     "query": {
      "count": 1,
      "created": "2013-04-12T09:12:51Z",
      "lang": "en-US",
      "results": {
       "Result": {
        "quality": "50",
        "latitude": "25.936119",
        "longitude": "83.532173",
        "offsetlat": "25.936119",
        "offsetlon": "83.532173",
        "radius": "1200",
        "name": "25.946314,83.534546",
        "line1": "25.946314,83.534546",
        "line2": "Belchaura",
        "line3": "Maunath Bhanjan 275101",
        "line4": "India",
        "house": null,
        "street": null,
        "xstreet": null,
        "unittype": null,
        "unit": null,
        "postal": "275101",
        "neighborhood": "Belchaura",
        "city": "Maunath Bhanjan",
        "county": "Mau",
        "state": "Uttar Pradesh",
        "country": "India",
        "countrycode": "IN",
        "statecode": "UP",
        "countycode": null,
        "uzip": "275101",
        "hash": null,
        "woeid": "29125439",
        "woetype": "7"
       }
      }
     }
    }
    
    0
  • I tried using the YQL but for some coordinates it gives me woetype: 12 which is the country's woeid

    0

Recent Posts

in General Discussion at YDN