GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Finding closest city by lat, lng  XML
Forum Index -> General
Author Message

Joined: 09/04/2017 01:50:24
Messages: 1

I am new to GeoNames but very impressed by the amount of info here. Here is my question, I have researched it a bit but was unsure. I have a mobile app which gives me the user's location (lat, lng) . If I want to get the closest large city to them how can I accomplish this with the Geonames API.

I read!searchin/geonames/big$20cities%7Csort:relevance/geonames/r4bJc9Kl5Gs/LFZ3ZbffRKMJ about a similar question and it was suggested i can use to get the results of cities within a bounding box which returns a list of cities ordered by relevancy (capital/population). This seems exactly what I want, but how can i calculate the bounding box from lat, lng to get the closest city? for example if i am in a suburb of Atlanta and the suburbs location is as follows

lat = 33.9
lng = -83.9

What would be the north, south, east, west coridinates? are these miles? from the center? to get Atlanta city

Please explain what are the north south east west parameters? and how can i get them dynamically for a given lat, lng. Your help is really appreciated as i was having a hard time finding this info. Thanks in advance!!
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team