## How to convert an address to a latitude/longitude?

Google has a geocoding API which seems to work pretty well for most of the locations that they have Google Maps data for. http://googlemapsapi.blogspot.com/2006/06/geocoding-at-last.html They provide online geocoding (via JavaScript): http://code.google.com/apis/maps/documentation/services.html#Geocoding Or backend geocoding (via an HTTP request): http://code.google.com/apis/maps/documentation/services.html#Geocoding_Direct The data is usually the same used by Google Maps itself. (note that there are some … Read more

## Trilateration using 3 latitude and longitude points, and 3 distances

Wikipedia gives a pretty thorough discussion of the algebra here: http://en.wikipedia.org/wiki/Trilateration The first step, not really covered in the Wikipedia entry, is to convert your lat/long coordinates to Cartesian coordinates: x0 = cos( lon0 ) * cos( lat0 ) , y0 = sin( lon0 ) * cos( lat0 ) , z0 = sin( lat0 ) … Read more

## How to calculate the bounding box for a given lat/lng location?

I suggest to approximate locally the Earth surface as a sphere with radius given by the WGS84 ellipsoid at the given latitude. I suspect that the exact computation of latMin and latMax would require elliptic functions and would not yield an appreciable increase in accuracy (WGS84 is itself an approximation). My implementation follows (It’s written … Read more