latitude-longitude

How can I quickly estimate the distance between two (latitude, longitude) points?

自闭症网瘾萝莉.ら 提交于 2019-12-17 06:28:24
问题 I want to be able to get a estimate of the distance between two (latitude, longitude) points. I want to undershoot, as this will be for A* graph search and I want it to be fast . The points will be at most 800 km apart. 回答1: The answers to Haversine Formula in Python (Bearing and Distance between two GPS points) provide Python implementations that answer your question. Using the implementation below I performed 100,000 iterations in less than 1 second on an older laptop. I think for your

How can I get city name from a latitude and longitude point?

给你一囗甜甜゛ 提交于 2019-12-17 05:39:33
问题 Is there a way to get a city name from a latitude and longitude point using the google maps api for javascript? If so could I please see an example? 回答1: This is called Reverse Geocoding Documentation from Google: http://code.google.com/apis/maps/documentation/geocoding/#ReverseGeocoding. Sample Call to Google's geocode Web Service: http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true&key=YOUR_KEY 回答2: Here is a complete sample: <!DOCTYPE html> <html> <head

How can I get city name from a latitude and longitude point?

陌路散爱 提交于 2019-12-17 05:39:06
问题 Is there a way to get a city name from a latitude and longitude point using the google maps api for javascript? If so could I please see an example? 回答1: This is called Reverse Geocoding Documentation from Google: http://code.google.com/apis/maps/documentation/geocoding/#ReverseGeocoding. Sample Call to Google's geocode Web Service: http://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true&key=YOUR_KEY 回答2: Here is a complete sample: <!DOCTYPE html> <html> <head

Calculating distance between two points, using latitude longitude?

邮差的信 提交于 2019-12-17 01:39:31
问题 Here's my try, it's just a snippet of my code: final double RADIUS = 6371.01; double temp = Math.cos(Math.toRadians(latA)) * Math.cos(Math.toRadians(latB)) * Math.cos(Math.toRadians((latB) - (latA))) + Math.sin(Math.toRadians(latA)) * Math.sin(Math.toRadians(latB)); return temp * RADIUS * Math.PI / 180; I am using this formulae to get the latitude and longitude: x = Deg + (Min + Sec / 60) / 60) 回答1: The Java code given by Dommer above gives slightly incorrect results but the small errors add

Calculating Distance between two Latitude and Longitude GeoCoordinates

谁说胖子不能爱 提交于 2019-12-17 00:33:21
问题 I'm calculating the distance between two GeoCoordinates. I'm testing my app against 3-4 other apps. When I'm calculating distance, I tend to get an average of 3.3 miles for my calculation whereas other apps are getting 3.5 miles. It's a big difference for the calculation I'm trying to perform. Are there any good class libraries out there for calculating distance? I'm calculating it like this in C#: public static double Calculate(double sLatitude,double sLongitude, double eLatitude, double

Calculating Distance between two Latitude and Longitude GeoCoordinates

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-17 00:33:09
问题 I'm calculating the distance between two GeoCoordinates. I'm testing my app against 3-4 other apps. When I'm calculating distance, I tend to get an average of 3.3 miles for my calculation whereas other apps are getting 3.5 miles. It's a big difference for the calculation I'm trying to perform. Are there any good class libraries out there for calculating distance? I'm calculating it like this in C#: public static double Calculate(double sLatitude,double sLongitude, double eLatitude, double

Calculating distance between two geographic locations

…衆ロ難τιáo~ 提交于 2019-12-16 20:12:43
问题 please shed some light on this situation Right now i have two array having latitude and longitude of nearby places and also have the user location latiude and longiude now i want to calculate the distance between user location and nearby places and want to show them in listview. I know that there is a method for calculating distance as public static void distanceBetween (double startLatitude, double startLongitude, double endLatitude, double endLongitude, float[] results); Now what is the

What is the ideal data type to use when storing latitude / longitude in a MySQL database?

守給你的承諾、 提交于 2019-12-16 19:50:03
问题 Bearing in mind that I'll be performing calculations on lat / long pairs, what datatype is best suited for use with a MySQL database? 回答1: Use MySQL's spatial extensions with GIS. 回答2: Google provides a start to finish PHP/MySQL solution for an example "Store Locator" application with Google Maps. In this example, they store the lat/lng values as "Float" with a length of "10,6" http://code.google.com/apis/maps/articles/phpsqlsearch.html 回答3: Basically it depends on the precision you need for

Mysql geometry AREA() function returns what exactly when coords are long/lat?

China☆狼群 提交于 2019-12-13 19:26:54
问题 My question is somewhat related to this similar one, which links to a pretty complex solution - but what I want to understand is the result of this: Using a Mysql Geometry field to store a small polygon I duly ran select AREA(myPolygon) where id =1 over it, and got an value like 2.345. So can anyone tell me, just what does that number represent seeing as the stored values were long/lat sets describing the polygon? FYI, the areas I am working on are relatively small (car parks and the like)

How to get touch location latitude and longitude value from UIWebView in iPhone?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-13 19:18:40
问题 I'm working in iPhone application, Using UIWebView to load Google Map address and its works fine. Then i tried to get the touch location latitude and longitude value from UIWebView , but i didn't know that, How to do this? Is it possible to do this? please help me Thanks in Advance I tried this: webView=[[UIWebView alloc]initWithFrame:CGRectMake(0, 40, 320,376)]; webView.delegate=self; webView.scalesPageToFit=YES; NSLog(@"URL:%@",[user valueForKey:@"google_Address"]); NSString