# Tag Info

### Clustering spatial data in R?

Here is a solution based on Find clusters of points based distance rule, but using the distm function from the geosphere package: library(sp) library(rgdal) library(geosphere) # example data from ...
• 341

### Joining polygons in R

Here is a solution using the sf package: library(tidycensus) library(dplyr) library(sf) library(ggplot2) # get data from tindycensus for demonstration (note you need an API key, folow instructions ...
• 1,733

### Statistical tests for spatial line patterns?

This is a difficult question as there just have not been many, if any, spatial process statistics developed for line features. Without seriously digging into equations and code, point process ...

### Statistical tests for spatial line patterns?

You might want to look into Fréchet distance. I only recently found out about this after a recent question looking for a python implementation. This is a metric for finding spatial similarity of ...
• 20.5k
Accepted

### Calculating field AVG from B layer 3 nearest points to each A layer point

Sorry, I can not provide an answer for QGIS 3.4, but for 3.8+, in case you have a chance to update. The tool you need for this is called join attributes by nearest, which was introduced with 3.8. For ...
• 35.2k
Accepted

### Getis-Ord Gi* (arcgis 'hotspot analysis') with python?

Check out PySAL: The Python Spatial Analysis Library https://pysal.readthedocs.io/en/latest/
• 1,966
Accepted

### Dividing Polygon into parts which have equal area using R

As I needed something similar, I wrote a small function for R following the steps of this question on "Splitting polygon into equal area polygons using QGIS" I hope this helps somebody, even ...
• 96
Accepted

### Calculating statistics of points within polygons of the same criterion in QGIS

Great question. Welcome to the weird and wonderful world of the aggregate() function. It's very powerful but tricky to learn, I've used it a lot and still have to read the documentation carefully most ...
• 6,190

### Polygon Shape Similarity using PostGIS?

Have a look at the PostGIS function - ST_HausdorffDistance http://postgis.net/docs/ST_HausdorffDistance.html This is a measure of how similar or dissimilar two shapes are.
• 1,870

### Distance between GPS travel route and country border

You can do this using QGIS and OpenStreetMap data, so OpenSource/Open data and free to use. The process includes several steps. Using the online QGIS documentation can help you for the steps. When you ...
• 73.8k

### Geometry type issue with st_intersection() between polylines and polygons

The ST_Intersection can produce different geometry-types in one go (image two lines intersecting at one point, returning a point) and likely therefore you are receiving linestrings and ...
• 3,279
Accepted

### Optimally thin or subset sample points

There is a function pp.subsample in the spatialEco package that will subset your data using a spatial intensity function. This will, in effect, thin your data to a defined n, using the expected ...

### Computing annual spatial (zonal) statistics of a NetCDF file for polygons in shape-file

I used this code to get want I wanted: # import packages import xarray as xr import rasterio as rio import geopandas as gpd import rasterstats as rstats # load and read shp-file with geopandas ...
• 99

### Calculating buffer distance for different groups of parallel lines in QGIS

What you want to achieve is basically a kind of "clustering" of lines: grouping lines that are close together. You need one manual decision, a maximum distance up until which lines should be ...
• 73.8k
Accepted

### Interpolation with 10 data points

Both methods are "appropriate". IDW basically says "half way between a point valued 6 and a point valued 8 the value is going to be 7", but extended to the distance to multiple ...
• 65.5k
Accepted

### Computing grid cell statistics using LiDAR point cloud in QGIS

With QGIS 3.32 (see the changelog) you have some native algorithm in the Processing Toolbox (Ctrl+Alt+T), there you can export the point cloud into a raster format, DEM for example and make statistics ...
• 11.6k
Accepted

### Spatial outliers detection in R?

We can run through some straight-forward approaches starting with looking at the modified z-score on the variable of interest (a-spatial) then move to calculating the local z-score and variance within ...

### Statistical tests for spatial line patterns?

I am suggesting to use approach similar to one explained here. ALGORITHM and naming: a) Name line layer NODES. Compute bearings b) spatially join to itself (one to many) using distance tolerance. ...
• 23.2k

### Statistical tests for spatial line patterns?

There is in my eyes a problem with the definition of the lines, one that will determine what approaches to use ( some of those mentioned above). If these are OD pairs, and the geometry does not play a ...
• 886

You can access this table via levels: > levels(r) [[1]] ID OID Value Count LC_Code Land_Cover Area_Ha 1 0 0 0 25615512 255 No Data 2305400.00 2 1 1 ...
• 65.5k

### Choosing spatial statistical tool in ArcGIS Desktop?

Spatial Statistics Resources or https://spatialstats.github.io/. This page made in 2010 in the esri blog,But esri update it when a new resource availabled. The ESRI Guide to GIS Analysis, Volume 2. ...
• 5,825
Accepted

### Calculating Moran's I on large point dataframe in R

I had this same problem. I created an R package that calculates the distance matrix on the fly, so it takes much less memory to calculate Moran's I. Its also quite fast. You can find it at github....
• 670
Accepted

### How to obtain elevation differences between point and raster cell in R

Outline solution: Install the FNN package from CRAN. Use nni = FNN::knnx.index(coordinates(s), coordinates(r), k=1) to get the index in s of the nearest neighbour for each cell coordinate to the ...
• 65.5k

### Do I necessarily need coordinates for spatial prediction?

The spatial prediction aims at predicting a variable where it has not been observed. Therefore you need to know the coordinates of the location where you make the prediction, even if the coordinates ...
• 49.8k

### Distance between GPS travel route and country border

With QGIS you can use the following processing tools: GPS route as input: Densify by interval (add vertices every 1 m) Extract vertices (create a point layer from the vertices) With country border ...
• 76.2k

### Determining who and why certain data was mapped in OpenStreetMap

OSM is a collaborative geographic database, fed by the goodwill of volunteer contributors. Therefore there are no real input specifications (as there might be in a reference database), just guidlines, ...
• 1,557

### Interpreting semivariogram with high nugget effect?

I am wondering if someone can explain why the nugget seems so high? Does this mean that even at similar locations, there is still a relatively high degree of difference? Yes, a high nugget effect (...
• 10.3k

### Which statistical methods to compare the spatial distribution of two different variables in two raster maps?

tl;dr: pick a segregation measure from the seg package, probably the isp() function as an implementation of White (1983). I'd recommend using an entropy segregation measure. Probably you need some ...
• 71
Accepted

### Gstat krige() error: Covariance matrix singular at location [917300,3.6109e+06,0]: skipping

This is caused by the matrix library used by gstat. Historically (gstat was released as open source code in 1997) it used the LDLfactor routine in the meschach library. Around 6 months ago I factored ...
• 2,079