geographic-distance

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

Fuzzy matching of coordinates

本小妞迷上赌 提交于 2019-12-05 07:18:42
问题 I have two datasets, one of them containing the coordinates of people's addresses ( addresses ), and the other one containing the coordinates of rainfall in certain locations ( rain ). The coordinates are standard lat and lon. I would like to merge these two sets together, by matching each address to the nearest rainfall location, using the spherical distance between two coordinates to determine the "nearest". The naive way is to compute all pairwise distances between each address and each

How to assign a name to lat-long observations based on shortest distance

女生的网名这么多〃 提交于 2019-12-02 17:25:00
问题 I have two dataframes: df1 contains observations with lat-lon coordinates; df2 has names with lat-lon coordinates. I want to create a new variable df1$name which has for each observation the name of df2 that has the shortest distance to that observation. Some sample data for df1 : df1 <- structure(list(lat = c(52.768, 53.155, 53.238, 53.253, 53.312, 53.21, 53.21, 53.109, 53.376, 53.317, 52.972, 53.337, 53.208, 53.278, 53.316, 53.288, 53.341, 52.945, 53.317, 53.249), lon = c(6.873, 6.82, 6.81,

How to assign several names to lat-lon observations

≡放荡痞女 提交于 2019-12-02 14:44:46
问题 I have two dataframes: df1 contains observations with lat-lon coordinates; df2 has names with lat-lon coordinates. I want to create a new variable df1$names which has for each observation the names of df2 that are within a specified distance to that observation. Some sample data for df1 : df1 <- structure(list(lat = c(52.768, 53.155, 53.238, 53.253, 53.312, 53.21, 53.21, 53.109, 53.376, 53.317, 52.972, 53.337, 53.208, 53.278, 53.316, 53.288, 53.341, 52.945, 53.317, 53.249), lon = c(6.873, 6

工具导航Map

JSON相关