GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Trying to optimizing API usage  XML
Forum Index -> General
Author Message
gnmwlde



Joined: 28/08/2018 20:27:10
Messages: 4
Offline

Forgive me if this is something easy and I just did not find the corresponding documentation. I'm grateful for any pointer or suggestion.

For a given set of lat/lon coordinates I need to figure out

Country
State/Province,
ZIP (Postal Code)
City
{Street Name or 'Location' }

to fill image location metadata.

Currently I'm using up to 4 GeoNames.org webservice endpoints:

1. /findNearbyPlaceNameJSON

When this does not return an Altitude I use

2. /astergdemJSON

Then I calll

3. /findNearbyPostalCodesJSON

to get the ZIP if available.
If no street name was found so far, I also call

4. /findNearbyStreetsOSMJSON

I'm trying to reduce the number of endpoint calls to reduce to reduce server load and to process more files with less credits.

Is there a better endpoint? Some that returns all the requested data in one call perhaps?Code:

		
gnmwlde



Joined: 28/08/2018 20:27:10
Messages: 4
Offline

I assume that there is no better way then?
marc



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

If you know the country then you could use the new address service:
http://www.geonames.org/maps/addresses.html#address
It is available for 17 countries so far and includes most of the information you need. The elevation is not yet included. For the elevation you can reduce the credits usage when you combine many lat/lng in one call. In particular if they are nearby the credits usage will be smaller.

findNearbyPostalcode never has a street name. You could first call OSM and if it does not include a postal code you can then call the postal code service.

[WWW]
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team