GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
US states... something changed??  XML
Forum Index -> General
Author Message
darrensunley



Joined: 28/08/2018 11:38:22
Messages: 2
Offline

Hi,

For a long time now I've been using your webservices to reverse lookup places in the US to confirm the state they're in, which then allows me collect a list of all the US States I've visited (for my personal holiday website).

This was all working fine until I tried using my page yesterday and it failed on a couple of the lookups - which had previously worked for a long time (at least a couple of years I'd say).

Has something changed?

An example of one that used to work but now fails is Key West, which I lookup as follows...

https://secure.geonames.org/countrySubdivision?lat=24.55&lng=-81.766666666667&username=<myusername>

Here's an example of one that still works...

https://secure.geonames.org/countrySubdivision?lat=40.7438889&lng=-74.0327778&username=<myusername>

As you can see, the "failing" one simply doesn't return the adminCode1, adminName1, or code fields.

Anyone able to suggest what's changed please? Or what I'm doing wrong?

Thanks in advance,
Darren
marc



Joined: 08/12/2005 07:39:47
Messages: 4412
Offline

Hi Darren

Thanks a lot for reporting. It is data bug. We have recently updated the adm1 and adm2 boundaries for the US with coastline boundaries as we have in most other countries. This means your first location is in the water and outside of the boundary.
The fix is to get the closest boundary and define a radius in your query. However, I have just seen we have not yet updated the country boundary with the same quality as the adm1 and adm2. The result is that the radius for the first query will not give the expected result as the current country boundary has the point within and will return radius 0. The adm1 and adm2 repsonses will be ignored as they are in a distance of 185m.

Action:
- You have to add a radius to your query (or use lat/lng on shore) (like radius=1 for a 1km radius)
- We have to update the country boundaries asap

Best Regards

Marc

[WWW]
marc



Joined: 08/12/2005 07:39:47
Messages: 4412
Offline

Your first query with the radius parameter:

https://secure.geonames.org/countrySubdivision?lat=24.55&lng=-81.766666666667&username=demo&radius=0.5

Will now return this document (with 185m distance from the shore line)

Code:
 <geonames>
 <countrySubdivision>
 <countryCode>US</countryCode>
 <countryName>United States</countryName>
 <adminCode1>FL</adminCode1>
 <adminName1>Florida</adminName1>
 <code level="1" type="ISO3166-2">FL</code>
 <distance>0.185148802646</distance>
 </countrySubdivision>
 </geonames>
 


Let me know if you have other lat/lng which do not return a adm1 even with the radius parameter.
Most areas have been update, some others (smaller ones) however are still in the works.

Marc

[WWW]
darrensunley



Joined: 28/08/2018 11:38:22
Messages: 2
Offline

Hi,

Thanks for your reply. Adding the radius parameter definitely has helped...

I do have one other failing data point, which was Atlantic City :

https://secure.geonames.org/countrySubdivision?lat=39.377297&lng=-74.451082&username=<user>&radius=1

The above works and the one below fails...

https://secure.geonames.org/countrySubdivision?lat=39.377297&lng=-74.451082&username=<user>

Cheers,
Darren
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team