latitude-longitude

how do I cluster a list of geographic points by distance?

被刻印的时光 ゝ 提交于 2020-01-11 03:26:04
问题 I have a list of points P=[p1,...pN] where pi=(latitudeI,longitudeI). Using Python 3, I would like to find a smallest set of clusters (disjoint subsets of P) such that every member of a cluster is within 20km of every other member in the cluster. Distance between two points is computed using the Vincenty method. To make this a little more concrete, suppose I have a set of points such as from numpy import * points = array([[33. , 41. ], [33.9693, 41.3923], [33.6074, 41.277 ], [34.4823, 41.919

Maps api: check if a marker falls to the left or right of a polyline

扶醉桌前 提交于 2020-01-07 06:40:06
问题 I'm currently developing an app using maps API, I have a polyline that is that start as LatLnt one and ends at LatLng two creating a straight line. If I have a Marker that falls somewhere close to this polyline how would I tell if the marker is to the left or to the right of the polyline? Are there any API utils that handles such geometric calculations? 回答1: You have coordinates L0, L1 for starting and ending points of line and marker coordinate P. Find azimuths for directions L0-L1 and L0-P

Sometime Google Distance Matrix ZERO_RESULTS returned

僤鯓⒐⒋嵵緔 提交于 2020-01-06 15:43:59
问题 It is my first question about that is working if I set default lat and long and now I try to get location current location and use that. Also I following this one Get User's Current Location / Coordinates but failed to reach result. I am not sure what is going on here it is not working try to do it several way func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { //print(locations) //get the actual location from the device and first one each move let

select restaurant table entries within a certain distance from current location using php

狂风中的少年 提交于 2020-01-06 04:52:09
问题 i have a database table with a list of restaurants including their names, latitudes, and longitudes. i would like to select all the restaurants that are within a certain distance from my current location. the current location is determined in the php file (right now i'm just using a static lat & lng). i found code for calculating the distance: function findDist($lat, $lng){ $currLat = 33.777563; $currLng = -84.389959; $currLat = deg2rad ($currLat); $sincurrLat = sin ($currLat); $lat = deg2rad

Determine center of bins when using meshm

陌路散爱 提交于 2020-01-06 04:46:22
问题 I am using meshm to plot densities. How do I calculate the center point for each of the bins? I want to associate the data in m with the centerpoints I have looked at the source code of meshm and believe the solution will be a modified version of meshm that returns the latitude and longitudes of each bin's center point. meshm calls the function meshgrat which returns the latitude and longitude points of the mesh that will be plotted by surfacem . The problem is that the lat and lon matrices

Method to locate nearest lng/lat locations without a 15 mile radius?

半世苍凉 提交于 2020-01-05 08:27:28
问题 Project: I have a MySQL database of alumni home address locations stored as lng/lat. I want to be able to identify groups of 15 members or more of alumni that live within a 15 mile radius of each other. Given a lng/lat, how do I select the other lng/lat locations that are within a 15 mile radius? I've installed on Linux the PHP geonames package from PEAR. It isn't clear to me if I can use this package for aid in this function. It contains radius routines, but they appear to be for returning

Method to locate nearest lng/lat locations without a 15 mile radius?

你。 提交于 2020-01-05 08:27:10
问题 Project: I have a MySQL database of alumni home address locations stored as lng/lat. I want to be able to identify groups of 15 members or more of alumni that live within a 15 mile radius of each other. Given a lng/lat, how do I select the other lng/lat locations that are within a 15 mile radius? I've installed on Linux the PHP geonames package from PEAR. It isn't clear to me if I can use this package for aid in this function. It contains radius routines, but they appear to be for returning

In JavaScript, How to extract latitude and longitude from string

安稳与你 提交于 2020-01-05 08:01:33
问题 I am extracting a string from a database which needs to be parsed into latitude and longitude separately, The string is defined as a "point", in the following format: (2.340000000,-4.50000000) I am trying to remove the parenthesis, and then parsed them with the method split() but I haven't been able to come up with a regular expressions that does the job right: So far I have tried many alternatives, and var latlong = "(2.34000000, -4.500000000)" latlong.replace('/[\(\)]//g',''); var coords =

In JavaScript, How to extract latitude and longitude from string

陌路散爱 提交于 2020-01-05 08:01:12
问题 I am extracting a string from a database which needs to be parsed into latitude and longitude separately, The string is defined as a "point", in the following format: (2.340000000,-4.50000000) I am trying to remove the parenthesis, and then parsed them with the method split() but I haven't been able to come up with a regular expressions that does the job right: So far I have tried many alternatives, and var latlong = "(2.34000000, -4.500000000)" latlong.replace('/[\(\)]//g',''); var coords =

Given a latitude / longitude to a certain number of decimal places, how to tell the area covered (in metres)?

房东的猫 提交于 2020-01-05 07:13:09
问题 If i have a position specified in latitude and longitude, then it can cover a box, depending on how many digits of accuracy are in the position. For example, given a position of 55.0° N, 3.0° W (i.e. to 1 decimal place), and assuming a truncation (as opposed to rounding), this could cover anything that's 55.01° to 55.09°. This would cover the area in this box: http://www.openstreetmap.org/?minlat=55.0&maxlat=55.1&maxlon=-3.0&minlon=-3.1&box=yes Is there anyway to calculate the area of that