Country not geotagged correctly when query is country only
I need to geolocalize countries but its coordinates are always out of its bounds.
For instance with Spain and Chile: http://where.yahooapis.com/geocode?q="Spain"&appid=[appid] http://where.yahooapis.com/geocode?q="Chile"&appid=[appid]
this is the response for Chile: <ResultSet version="1.0"><Error>0</Error><ErrorMessage>No error</ErrorMessage><Locale>us_US</Locale><Quality>87</Quality><Found>1</Found><Result><quality>9</quality><latitude>-37.020664</latitude><longitude>-87.946239</longitude><offsetlat>-35.705219</offsetlat><offsetlon>-71.341087</offsetlon><radius>2842800</radius><name/><line1/><line2/><line3/><line4>Chile</line4><house/><street/><xstreet/><unittype/><unit/><postal/><neighborhood/><city/><county/><state/><country>Chile</country><countrycode>CL</countrycode><statecode/><countycode/><uzip/><hash/><woeid>23424782</woeid><woetype>12</woetype></Result></ResultSet>
latitude = -37.020664 longitude = -87.946239 This point is located in the Pacific Ocean. The same thing happens with Spain (point in the sea).
I thought the logical behaviour in this case was to locate the point in the "middle" of the country, or at least in the country.
How can I get it right?
BTW, I am not always sure that I only have a country to process, sometimes it can be a full address (and it works great in this case).