geographic-distance

Measuring geographic distance with scipy

為{幸葍}努か 提交于 2020-02-27 09:52:16
问题 I fail to use the outcome of scipy 's pdist function. I am interested in the real geographic distance (preferred unit: km). Take the following coordinates: from scipy.spatial.distance import pdist coordinates = [ (42.057, -71.08), (39.132, -84.5155) ] distance = pdist(coordinates) print distance # [ 13.75021037] But what's the unit? Google says the distance between these two points is 1179 km. How do I get there from 13.75021037? 回答1: Using the latest Python 3, this now gives a deprecation

Measuring geographic distance with scipy

不想你离开。 提交于 2020-02-27 09:51:38
问题 I fail to use the outcome of scipy 's pdist function. I am interested in the real geographic distance (preferred unit: km). Take the following coordinates: from scipy.spatial.distance import pdist coordinates = [ (42.057, -71.08), (39.132, -84.5155) ] distance = pdist(coordinates) print distance # [ 13.75021037] But what's the unit? Google says the distance between these two points is 1179 km. How do I get there from 13.75021037? 回答1: Using the latest Python 3, this now gives a deprecation

Get pitch, roll and yaw relative to geographic north on iOS?

女生的网名这么多〃 提交于 2019-12-19 09:19:11
问题 I see that I can retrieve CMAttitude from a device and from it I can read 3 values which I need (pitch, roll and yaw). As I understand, this CMAttitude object is managed by CoreMotion which is a Sensor Fusion manager for calculating correct results from compass, gyro and accelerometer together (on Android it is SensorManager Class). So my questions are: Are those values (pitch, roll and yaw) relative to the magnetic north and gravity? If above is correct, how can I modify it to give me

Python module for storing and querying geographical coordinates

﹥>﹥吖頭↗ 提交于 2019-12-18 11:07:45
问题 Is there a Python module where I can create objects with a geographical location coordinate (latitude and longitude), and query all the objects for ones which are within a 5km distance (i.e. radius) of a given coordinate? I've been trying to store the latitude and longitude as keys in dictionaries (as they're indexed by key) and use some distance finding algorithms to query them. But this feels like a horrible hack. Essentially something like PostGIS for PostgreSQL, but all within my Python

Distance of wgs point from a wgs defined line segment

落爺英雄遲暮 提交于 2019-12-09 14:00:29
问题 I searched but I could not find a complete answer. In C# if at all possible. I need the shortest distance between a WGS point and a WGS point defined line segment on a sphere (Earth exactly). float DistanceInKilometres(PointF LineStartA, PointF LineEndB, PointF ThePoint) EDIT: Perhaps an illustration would help Please note that this is an ideal example. 'The point' could be anywhere on the surface of the sphere, the segment start-end, too. Obviously, I'm not looking for the distance through

Finding nearest neighbor between 2 sets of dated points

*爱你&永不变心* 提交于 2019-12-08 07:56:39
问题 I have 2 sets of points, set1 and set2 . Both sets of points have a data associated with the point. Points in set1 are "ephemeral", and only exist on the given date. Points in set2 are "permanent", are constructed at a given date, and then exist forever after that date. set.seed(1) dates <- seq(as.Date('2011-01-01'),as.Date('2011-12-31'),by='days') set1 <- data.frame(lat=40+runif(10000), lon=-70+runif(10000),date=sample(dates,10000,replace=TRUE)) set2 <- data.frame(lat=40+runif(100), lon=-70

SQL Geometry VS decimal(8,6) Lat, Long Performance

蓝咒 提交于 2019-12-07 07:11:33
问题 I was looking into performance of selecting closest points within certain proximity to given coordinate. Options are to ether use two decimal(8,6) - lat, long columns or single geography column and work with that. I am only interested which is faster? 回答1: TL;DR Geography is ~10 times faster. Ok so I have set up test: Couple of tables one with id,lat,long (int, decimal(8,6),decimal(8,6)) other with id,coord (int, geography) . Then insert 47k of random data. For indexing first table I used

Finding nearest neighbor between 2 sets of dated points

↘锁芯ラ 提交于 2019-12-06 15:46:48
I have 2 sets of points, set1 and set2 . Both sets of points have a data associated with the point. Points in set1 are "ephemeral", and only exist on the given date. Points in set2 are "permanent", are constructed at a given date, and then exist forever after that date. set.seed(1) dates <- seq(as.Date('2011-01-01'),as.Date('2011-12-31'),by='days') set1 <- data.frame(lat=40+runif(10000), lon=-70+runif(10000),date=sample(dates,10000,replace=TRUE)) set2 <- data.frame(lat=40+runif(100), lon=-70+runif(100),date=sample(dates,100,replace=TRUE)) Here's my problem: For each point in set1 (ephemeral)