geo

How to convert latitude or longitude to meters?

大憨熊 提交于 2019-11-26 12:40:56
If I have a latitude or longitude reading in standard NMEA format is there an easy way / formula to convert that reading to meters, which I can then implement in Java (J9)? Edit: Ok seems what I want to do is not possible easily , however what I really want to do is: Say I have a lat and long of a way point and a lat and long of a user is there an easy way to compare them to decide when to tell the user they are within a reasonably close distance of the way point? I realise reasonable is subject but is this easily do-able or still overly maths-y? b-h- Here is a javascript function: function

Given the lat/long coordinates, how can we find out the city/country?

萝らか妹 提交于 2019-11-26 12:36:18
For example if we have these set of coordinates "latitude": 48.858844300000001, "longitude": 2.2943506, How can we find out the city/country? Kevin The free Google Geocoding API provides this service via a HTTP REST API. Note, the API is usage and rate limited , but you can pay for unlimited access. Try this link to see an example of the output (this is in json, output is also available in XML) https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true Michael Borgwardt Another option: Download the cities database from http://download.geonames.org/export/dump/

Get nearest places on Google Maps, using MySQL spatial data

瘦欲@ 提交于 2019-11-26 08:05:06
问题 I have a database with a list of stores with latitudes and longitudes of each. So based on the current (lat, lng) location that I input, I would like to get a list of items from those within some radius like 1 km, 5km etc? What should be the algorithm? I need the PHP code for algorithm itself. 回答1: You just need use following query. For example, you have input latitude and longitude 37 and -122 in degrees. And you want to search for users within 25 miles from current given latitude and

Calculate the center point of multiple latitude/longitude coordinate pairs

烂漫一生 提交于 2019-11-26 06:53:33
问题 Given a set of latitude and longitude points, how can I calculate the latitude and longitude of the center point of that set (aka a point that would center a view on all points)? EDIT: Python solution I\'ve used: Convert lat/lon (must be in radians) to Cartesian coordinates for each location. X = cos(lat) * cos(lon) Y = cos(lat) * sin(lon) Z = sin(lat) Compute average x, y and z coordinates. x = (x1 + x2 + ... + xn) / n y = (y1 + y2 + ... + yn) / n z = (z1 + z2 + ... + zn) / n Convert average

Given the lat/long coordinates, how can we find out the city/country?

爷,独闯天下 提交于 2019-11-26 03:32:03
问题 For example if we have these set of coordinates \"latitude\": 48.858844300000001, \"longitude\": 2.2943506, How can we find out the city/country? 回答1: The free Google Geocoding API provides this service via a HTTP REST API. Note, the API is usage and rate limited, but you can pay for unlimited access. Try this link to see an example of the output (this is in json, output is also available in XML) https://maps.googleapis.com/maps/api/geocode/json?latlng=40.714224,-73.961452&sensor=true 回答2:

Getting distance between two points based on latitude/longitude

对着背影说爱祢 提交于 2019-11-26 03:04:49
问题 I tried implementing this formula: http://andrew.hedges.name/experiments/haversine/ The aplet does good for the two points I am testing: Yet my code is not working. from math import sin, cos, sqrt, atan2 R = 6373.0 lat1 = 52.2296756 lon1 = 21.0122287 lat2 = 52.406374 lon2 = 16.9251681 dlon = lon2 - lon1 dlat = lat2 - lat1 a = (sin(dlat/2))**2 + cos(lat1) * cos(lat2) * (sin(dlon/2))**2 c = 2 * atan2(sqrt(a), sqrt(1-a)) distance = R * c print \"Result\", distance print \"Should be\", 278.546

How to convert latitude or longitude to meters?

戏子无情 提交于 2019-11-26 03:03:54
问题 If I have a latitude or longitude reading in standard NMEA format is there an easy way / formula to convert that reading to meters, which I can then implement in Java (J9)? Edit: Ok seems what I want to do is not possible easily , however what I really want to do is: Say I have a lat and long of a way point and a lat and long of a user is there an easy way to compare them to decide when to tell the user they are within a reasonably close distance of the way point? I realise reasonable is