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

R convert zipcode or lat/long to county

I ended up using the suggestion from JoshO’Brien mentioned above and found here. I took his code and changed state to county as shown here: library(sp) library(maps) library(maptools) # The single argument to this function, pointsDF, is a data.frame in which: # – column 1 contains the longitude in degrees (negative in the US) # … Read more

Polygon area calculation using Latitude and Longitude generated from Cartesian space and a world file

I checked on internet for various polygon area formulas(or code) but did not find any one good or easy to implement. Now I have written the code snippet to calculate area of a polygon drawn on earth surface. The polygon can have n vertices with each vertex has having its own latitude longitude. Few Important … Read more

ggplot centered names on a map

Since you are creating two layers (one for the polygons and the second for the labels), you need to specify the data source and mapping correctly for each layer: ggplot(ny, aes(long, lat)) + geom_polygon(aes(group=group), colour=”black”, fill=NA) + geom_text(data=cnames, aes(long, lat, label = subregion), size=2) Note: Since long and lat occur in both data frames, you … Read more

How do I Geocode 20 addresses without receiving an OVER_QUERY_LIMIT response?

No, there is not really any other way : if you have many locations and want to display them on a map, the best solution is to : fetch the latitude+longitude, using the geocoder, when a location is created store those in your database, alongside the address and use those stored latitude+longitude when you want … Read more

tech