3
votes
Accepted
Which point lies on which linestring?
Use st_intersects which returns a list for each point of which features the point is on.
EG the nc data cast to linear features:
> nc
Simple feature collection with 100 features and 14 fields
...
3
votes
QGIS reads blank cells as "nan" instead of "NULL"
I wouldn't be able to help with sorting this in R, however regarding the post-processing in QGIS, you current request in the field calculator is:
if("field" = "nan", NULL, "...
1
vote
Accepted
Creating regular sampling grid, with specific distance between points using R
I would create a SpatRaster using the SpatVector as template, and set the resolution to 10 meters. Then you got a Raster with the desired gap that you can transform to points if needed.
On this ...
1
vote
Accepted
How to export result of point_metrics() in lidR?
There are plenty of options depending on what you really want to do.
You can keep only the points with min Z that way
library(lidR)
f = system.file("extdata", "Topography.laz", ...
1
vote
'union' between spatial polygons and spatial points in R
I found out how to do it.
Two ways:
applying point.in.poly(grid, acled). So x= polygons, y=points.
applying point.in.poly(ACLED, grid) in the right way then merging with the initial grid.
grid....
1
vote
Calculate sum/average of variable within each group of neighboring counties using R
I had this exact issue a few months ago working on a project and ended up developing a package to do just that.
I just now published the package on GitHub and can be installed in R by running devtools:...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
r × 5106raster × 1567
sf × 490
coordinate-system × 403
shapefile × 385
qgis × 349
polygon × 312
sp × 277
rgdal × 187
spatial-statistics × 172
arcgis-desktop × 154
lidr × 149
gdal × 139
python × 132
ggplot2 × 127
leaflet × 111
point × 102
lidar × 98
netcdf × 98
modis × 97
interpolation × 96
kriging × 93
distance × 90
geotiff-tiff × 89
extract × 84