local-reverse-geocoder icon indicating copy to clipboard operation
local-reverse-geocoder copied to clipboard

admin1Code, admin2Code are returned as string instead of object in API response

Open shivamsaxenadev opened this issue 1 year ago • 3 comments
trafficstars

Hi Thomas,

Thank you for building this extremely useful application! We have been using it in our app for a few months now, and the results have been accurate 99% of the time.

I noticed that in some cases, the admin1Code or admin2Code returns a string instead of an object. Is this expected behaviour? Here are the requests to reproduce the issue:

  • "admin1Code" : "00"

curl --location 'http://SERVER_URL/geocode?latitude=-16.48679&longitude=-151.74102'

  • "admin2Code" : "00"

curl --location 'http://SERVER_URL/geocode?latitude=52.51667&longitude=13.36667'

Please let me know if you need any other information.

shivamsaxenadev avatar Jul 19 '24 06:07 shivamsaxenadev

Could you verify if this is a problem in the downloaded GeoNames raw data? The app mostly just reflects what it finds there, without much processing if I recall correctly.

tomayac avatar Jul 22 '24 12:07 tomayac

Hi Thomas, thank you for your response. I appreciate your input on this matter. Unfortunately, I do not have the bandwidth to investigate this further at the moment. However, since this is not currently blocking my progress, I will aim to revisit it when I have more time available in the future.

shivamsaxenadev avatar Jul 25 '24 10:07 shivamsaxenadev

It seems to be related to use use of the option countries: [...] in the initialisation.

When I select a specific country, e.g., "IT" only a string is returned for adminNcode while if there are no countries it works as expected.

riccardoratta avatar Aug 07 '24 12:08 riccardoratta