sp

Subset spatial points with a polygon

人走茶凉 提交于 2021-02-10 12:50:13
问题 I have a SpatialPolygonsDataFrame (spolydf) and a SpatialPointsDataFrame (spointdf). The layers have different extents, but overlap. I can select points that fall within the polygon using fall.within.poly <- spointdf[spolydf,] How do I select points that fall outside the polygon? have tried fall.outside.poly <- spointdf[-spolydf,] but doesn't work. I'm mmissing something simple - any help please. 回答1: It's a bit late but I had the same issue today so I though that I would post my solution

Create hexagonal grid over city and associate with lon / lat points (in R)

╄→гoц情女王★ 提交于 2021-02-09 08:35:18
问题 I've been researching this for a while now but haven't come across any solution that fit my needs or that I can transform sufficiently to work in my case: I have a large car sharing data set for multiple cities in which I have the charging demand per location (e.g. row = carID, 55.63405, 12.58818, charging demand). I now would like to split the area over the city (example above is Copenhagen) up into a hexagonal grid and tag every parking location with an ID (e.g. row = carID, 55.63405, 12

Create hexagonal grid over city and associate with lon / lat points (in R)

允我心安 提交于 2021-02-09 08:34:19
问题 I've been researching this for a while now but haven't come across any solution that fit my needs or that I can transform sufficiently to work in my case: I have a large car sharing data set for multiple cities in which I have the charging demand per location (e.g. row = carID, 55.63405, 12.58818, charging demand). I now would like to split the area over the city (example above is Copenhagen) up into a hexagonal grid and tag every parking location with an ID (e.g. row = carID, 55.63405, 12

Create hexagonal grid over city and associate with lon / lat points (in R)

懵懂的女人 提交于 2021-02-09 08:33:32
问题 I've been researching this for a while now but haven't come across any solution that fit my needs or that I can transform sufficiently to work in my case: I have a large car sharing data set for multiple cities in which I have the charging demand per location (e.g. row = carID, 55.63405, 12.58818, charging demand). I now would like to split the area over the city (example above is Copenhagen) up into a hexagonal grid and tag every parking location with an ID (e.g. row = carID, 55.63405, 12

Create hexagonal grid over city and associate with lon / lat points (in R)

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-09 08:33:13
问题 I've been researching this for a while now but haven't come across any solution that fit my needs or that I can transform sufficiently to work in my case: I have a large car sharing data set for multiple cities in which I have the charging demand per location (e.g. row = carID, 55.63405, 12.58818, charging demand). I now would like to split the area over the city (example above is Copenhagen) up into a hexagonal grid and tag every parking location with an ID (e.g. row = carID, 55.63405, 12

Create polygon per row and retain columns

心已入冬 提交于 2021-01-27 17:30:12
问题 Good morning, afternoon or evening I have grouped some positional data into 1 hour bins. For each I have extract the minimum lat and lon. It looks like this: df <- "ID time_bin count lat lon maxlat minlat maxlon minlon 1 2018-10-07 22:00:00 47 51.21723 -5.021828 51.22082 51.21457 -5.019105 -5.024372 2 2018-10-07 23:00:00 61 51.21797 -4.907367 51.23592 51.21224 -4.743538 -5.018899 3 2018-10-08 00:00:00 65 51.27263 -4.612118 51.32474 51.23751 -4.576005 -4.734378 4 2018-10-08 01:00:00 107 51

Fastest cartesian distance (R) from each point in SpatialPointsDataFrame to closest points/lines in 2nd shapefile

核能气质少年 提交于 2020-06-13 11:28:41
问题 I want to know the fastest algorithms for obtaining the cartesian distances between each point in a SpatialPointsDataFrame ( X ) and either (a) the closest point in a second SpatialPointsDataFrame ( Y ), or (b) the closest line segment in a SpatialLinesDataFrame ( Y ). So this is basically 2 questions, with perhaps the same answer. For the lines, I know I can use dist2Line(X,Y, distfun=distGeo) but this is insanely slow. I also tried using nncross , after converting both X and Y to ppp

Fastest cartesian distance (R) from each point in SpatialPointsDataFrame to closest points/lines in 2nd shapefile

房东的猫 提交于 2020-06-13 11:28:13
问题 I want to know the fastest algorithms for obtaining the cartesian distances between each point in a SpatialPointsDataFrame ( X ) and either (a) the closest point in a second SpatialPointsDataFrame ( Y ), or (b) the closest line segment in a SpatialLinesDataFrame ( Y ). So this is basically 2 questions, with perhaps the same answer. For the lines, I know I can use dist2Line(X,Y, distfun=distGeo) but this is insanely slow. I also tried using nncross , after converting both X and Y to ppp