Luc
Luc

Reputation: 17072

Only getting city from GPS coordinates

Is there a way to only get the city name from gps coords ?

curl 'http://maps.google.com/maps/api/geocode/xml?latlng=43.7,7.26&sensor=false'

gives me several addresses, much more than I need. I did not find any filter options in the query, I would expect something like an additionnal "q=city" for instance.

Upvotes: 1

Views: 477

Answers (2)

LONGI
LONGI

Reputation: 11443

I found GeoLite. At least for those who need the centre location of cities using an integrated database.

Upvotes: 1

Luc
Luc

Reputation: 17072

I finally used geocoder module (for node.js) and parse the json response to get the locality.

Upvotes: 0

Related Questions