From GPS coordinates to place name
Here's a small web service that receives lat, lon coordinates (typically from a GPS) and gives you a hint as to where in Norway that spot is.
Accepts the following queries:
/geolocate.php?lat=57.9892&lon=7.06157
try it/geolocate.php?gps={"coords":{"latitude":57.9892,"longitude":7.06157}}
try it/geolocate.php?postalcode=9012
try itReturns JSON, utf8 encoded:
{ "county": 19, // required field "countyname": "Troms", // required field "postalcode": null, // optional field "name": null, // PLACE NAME optional field "municipality": null, // optional field "municipalitycode": null // optional field }
A table of (lat,lon)→ place,municipality mappings is populated with data from yr.no. A script finds the closest point and returns the name of the place and some other data.
Yeah, knock yourself out. Add &callback=functionName
to the query.
Golly, I'm not sure. Please suggest to havard@gulldahl.no.
The service is (C) Håvard Gulldahl, it's released under the AGPL license and you can run it, too! It's on gitorious, go get it there.