Get street address at lat/long pair
Google again http://nicogoeminne.googlepages.com/documentation.html http://groups.google.com/group/Google-Maps-API/web/resources-non-google-geocoders
Google again http://nicogoeminne.googlepages.com/documentation.html http://groups.google.com/group/Google-Maps-API/web/resources-non-google-geocoders
Use the measurements package from CRAN which has a unit conversion function already so you don’t need to make your own: x = read.table(text = ” lat long 105252 30°25.264 9°01.331 105253 30°39.237 8°10.811 105255 31°37.760 8°06.040 105258 31°41.190 8°06.557 105259 31°41.229 8°06.622 105260 31°38.891 8°06.281″, header = TRUE, stringsAsFactors = FALSE) Once your data.frame … Read more
Here’s my own solution, based on the idea in ask Dr. Math. I’d be happy to see your feedback. Disclaimer first. This solution is correct for spheres. Earth isn’t a sphere, and the coordinates system (WGS 84) doesn’t assume it’s a sphere. So this is just an approximation, and I can’t really estimate is error. … Read more
I had this problem a while back and did exactly what adam suggested: Download the database of cities from geonames.org convert it to a compact lat/lon -> timezone list use an R-Tree implementation to efficiently lookup the nearest city (or rather, its timezone) to a given coordinate IIRC it took less than 1 second to … Read more
Calculate a bounding box to select a subset of the rows in the WHERE clause of your SQL query, so that you’re only executing the expensive distance calculation on that subset of rows rather than against the entire 200k records in your table. The method is described in this article on Movable Type (with PHP … Read more
One of the former students in our lab used some applicable techniques for his PhD thesis. I believe one of them is called “alpha shapes” and is referenced in the following paper: http://www.cis.rit.edu/people/faculty/kerekes/pdfs/AIPR_2007_Gurram.pdf That paper gives some further references you can follow.
Ok, for starters, you don’t really need to use the Haversine formula here. For large distances where a less accurate formula produces a larger error, your users don’t care if the match is plus or minus a few miles, and for closer distances, the error is very small. There are easier (to calculate) formulas listed … Read more
This is a classic JavaScript mistake. this in JavaScript does not necessarily refer to your class instance object. It is the context of the function when it is called. You can force this context with bind, and in many libraries you can easily force it as well. In this case with Leaflet you can pass … Read more
There several ways to do this. 1) Integrate the contributions from latitudinal strips. Here the area of each strip will be (Rcos(A)(B1-B0))(RdA), where A is the latitude, B1 and B0 are the starting and ending longitudes, and all angles are in radians. 2) Break the surface into spherical triangles, and calculate the area using Girard’s … Read more