Questions tagged [nearest-neighbor]

A technique for resampling raster data in which the value of each cell in an output raster is calculated using the value of the nearest cell in an input raster.

Filter by
Sorted by
Tagged with
0
votes
0answers
21 views

On the calculus of the variable “autocov” from spdep package

I’m facing a spatial autocorrelation problem and I want to calculate the «  autocov» covariate through the function autocov_dist from spdep package. The problem is when I defined the neighborhood ...
1
vote
0answers
39 views

Nearest unique duplicate points

How can I highlight nearest(certain distance) unique duplicates? Actually I tried a process in ArcGIS but only duplicates are pulled out from the entire file without considering distance. How can I do ...
0
votes
0answers
34 views

Find for each point-feature in layer the nearest point in other point-ayer over a network

I'm looking for a solution for following problem: given a point layer A (10.000 points) given a point layer B (15.000 points) given a line layer C, as network (waternetwork) I want to have for each ...
5
votes
3answers
159 views

Find nearest line feature from point in QGIS

I have a line feature set and point feature set. I want to get the nearest line feature from every point. For this, the line features are converted to point using "Extract Nodes" tool. Then ...
5
votes
1answer
80 views

Temporal nearest neighbour analysis in QGIS

How do I conduct a temporal nearest neighbour analysis in QGIS? Not sure if that's the right terminology, but basically, I have a dataset with ~100,000 house price transactions over a 5 year period. ...
0
votes
1answer
16 views

Combining information from two point layers based on the nearest neighbour relationship

I have two layers: One a modeled dataset with points on a 1x1km grid across the globe. I also have another layer which is my own data points which are scattered across the globe. What I want to do is ...
2
votes
1answer
75 views

Calculating minimum distance between two point layers within polygons in QGIS

I have three vector layers two points and one polygon: Centroids (POINTS FROM) NUTS_ID | CNTR_CODE | NUTS_NAME | id Sorting_plants_2020 (POINTS TO) postcode | name | where | capacity | id ...
4
votes
1answer
48 views

Nearest neighbor distance in km over contiguous US

I have two sets of line features in QGIS (rivers & roads - I'd like to find the road segment nearest to each river segment & the distance between them in km) across the contiguous United ...
2
votes
0answers
71 views

How to interpret Nearest Neighbour Index (NNI) and Z-Score in Nearest Neighbour Analysis (QGIS)

I performed a Nearest Neighbour Analysis in QGIS (3.4) via Vector > Analysis Tools > Nearest Neighbour Analysis on two different point patterns (13 archaeological sites in each). I am struggling ...
1
vote
0answers
32 views

How determine optimal epsilon value in meters for DBSCAN by plotting KNN elbow

Before doing DBSCAN I need to find optimal epsilon value, all the points are geographical coordinates, I need the epsilon value in meters before convert it to radians to apply DBSCAN using haversine ...
3
votes
2answers
110 views

Spatially join attributes from point to polygon side with numerous contiguous polygons and numerous adjacent points

I have been trying for 2 days to join points representing addresses (in Paris region) to the closest polygon (parcel of land). The problems: The parcels of land are contiguous, sometimes a point ...
1
vote
1answer
29 views

Using NNJoin-Plugin through Python console

I want to write a Python script which I can execute from within QGIS 2.18 (from the Python console). The Python script should calculate the nearest line (out of a set of lines) of a given point (out ...
1
vote
0answers
51 views

KNN with “Big Data”

I have a point dataset of over 30mill records and I am trying to select the closest 5 lines to each point. Reading this post there seems to be two methodologies Using <-> however as I want to ...
2
votes
0answers
49 views

Generating similar random points in QGIS

I have data (Lat, Lon) of 32 buildings, and their plot in QGIS is given below in red dots. Now based on the calculated mean distance (Nearest neighbor analysis) between these points, I want to ...
1
vote
1answer
37 views

Nearest neighbor distance for Arctic area that spans 2-3 UTM zones

Using QGIS3.10, I have tried Distance Matrix and NNJoin (distance results 0 - 10.32 for both, likely in degrees). I have 93 points of 2 types in one shapefile. I have the same distance issue if the ...
0
votes
0answers
26 views

Accounting of strength of spatial autocorrelation between some grocery stores in distance 500 meters

I'm analyzing sales one supermarket chain and I want to know how other neighborhood stores influence on turnover store. I have data about other stores and their location. As a result, I need to get ...
0
votes
0answers
39 views

Google Earth Engine: When mean pixel value is blank, take nearest pixel value

I have a code for calculating the mean value of a variable, and reducing it to get values for 5 regions of interest. The full earth engine code for this is here. However, I'm getting blank/null values ...
3
votes
1answer
112 views

Linking points and line layers

I have a points layer and a polyline layer. The points layer is basically bus stops and the line layer is the road network. The bus stops may or may not fall exactly on the road network layer. I want ...
0
votes
0answers
23 views

How to evaluate the statistic significance in the Neighbour Nearest Test?

I'm reviewing a scientific article to be publish. I tried to evidence that pathogens collected from different geographic areas clustered. I used Nearest Neighbour test to prove it. However, I've ...
0
votes
2answers
89 views

QGIS: Lines between multiple nearest neighbors

So I have a set of hubs and spokes and want to connect each spoke to its three nearest hubs. I used the distance matrix method (Returning Multiple Nearest Neighbors) and now I have a (MultiPoint) shp-...
1
vote
0answers
35 views

Nearest Neighbor Global matching

I'm trying to compare two datasets; a satellite image and some known points. In the satellite image I've got 20 to 50 detections that should match up to a set of lat/lon points that I have. There is ...
0
votes
0answers
51 views

What percent of non-zero weights should I aim for when selecting value of k?

I am attempting to test for spatial-autocorrelation among regression residuals via Moran's I in R using the 'spdep' package. While creating the spatial weights, changing the value of k changes the ...
1
vote
0answers
88 views

Nearest neighbours with Python [closed]

I'm learning Python and this has been a bit of a challenge! My DataFrame looks like this below. name geometry 0 Uimastadion POINT (24.93045 60.18882) 1 Hartwall ...
2
votes
1answer
371 views

R {spdep} Get list of neighbors from nb object

I want to identify the specific neighbors of each polygon within a SpatialPolygonDataFrame from nb object. I know I can get the number of neighbors by polygon id by card(nb), but how to get the list ...
1
vote
1answer
500 views

How to find closest point on a line from a point in Oracle Spatial?

I want to find the nearest point on a line from a point in Oracle Spatial. I know how to do in SQL Server and PostgreSQL but could not find anything about Oracle. I have used MDSYS.sdo_nn to find the ...
4
votes
1answer
106 views

QGIS - How to find the distance for the nearest polygon from point for a defined angle?

I'm using QGIS 3.1 and I want to find the distance from a point to the nearest polygon for a given direction. So for example, for each point in my point layer I want to find the distance to nearest ...
1
vote
1answer
122 views

How to find nearest neighbor in Oracle's ST_GEOMETRY?

I am trying to find nearest road segment to a point in Oracle. I can do this with SDO_GEOMETRY type i.e select /*+ LEADING(pois) INDEX(route ALL_ROUTES_SPTAIL_INDEX) */ route.* from DEVICE_STATUS ...
1
vote
0answers
30 views

Distance Point x,i from nearest Point x,j report Point x,j ID in r

I have a sample of points villages x,i, and I want to know the distance between each village x,i and the nearest village x,j. The i, and j depicts two different samples. I am able to find the distance ...
0
votes
0answers
13 views

Linking clusters and masks by a common identifier

In ArcMap, I have raster clusters with unique identifiers. Around each cluster I have masks. Is there any way to carry each of the clusters' identifiers over to the attribute table of its closest ...
1
vote
1answer
47 views

Cut hole in raster with shapefile and sample at closest edges

I have a raster in which I'd like to cut a "hole" with a shapefile. I have points close to the boundary, but inside the hole, and I would like to find the closest point on the edge. To give a concrete ...
1
vote
1answer
44 views

ST_ClosestPoint() moves all points to one line instead of closest line

I have a line network and I've created evenly-spaced points along those lines. The problem is that the points are not exactly on the line so subsequent overlay operations will not work as expected. I'...
7
votes
1answer
267 views

Rockfall analysis (Nearest neighbor downhill) in QGIS

I am working on a rockfall guide for QGIS and I'm currently stuck on one of the stages. I currently at a point in the guide where I have two point layers one "rockfall release point"-layer and "...
1
vote
1answer
37 views

Nearest Neighbor Two Point Tables Return Line Geometry

I am looking to find the nearest neighbor between two point tables in PostGIS and return the ids of both along with the line geometry. I have been able to determine the distance for the nearest ...
4
votes
1answer
531 views

Spatial 1 to 1 join by proximity in sf and R?

I'm trying to join a Simple Feature of POINT geometry type to another Simple Feature of POLYGON geometry type using st_join and nngeo::st_nn as the person asking this other question also did. The ...
2
votes
1answer
109 views

ST_Distance does not give nearest node

I am trying to find the nearest point on the road network closest to a given point. I imported the road network into PostGIS from QGIS and am using the SQL window in QGIS DB Manager to query the road ...
2
votes
1answer
135 views

Distinct st_shortestline

I have 61 pts and numerous rds. I would like to find the shortest distance to the nearest road using st_shortestline. I need 61 unique line segments, one for each point to its nearest road. Instead I ...
4
votes
1answer
575 views

Calculating nearest neighbor within each polygon using QGIS?

I have 3 layers: world map divided into countries; layer of points representing cities; layer of points representing conflict events (e.g. firefight). My goal: For each city, calculate the nearest ...
3
votes
2answers
187 views

Calculating distance between multiple lines of points in QGIS?

I'm looking to calculate a distance from a sensor reading to that of the nearest sensor reading on a different sensor line, all held within the same points file. Ideally using QGIS. The image below ...
0
votes
0answers
40 views

NearestNeighbor producing bad quality tiles

I have been using Bicubic interpolation to render some basemaps because this produced good results. This is what I get when using Bicubic: However, when using Nearest Neighbor interpolation, a white ...
0
votes
0answers
34 views

Finding nearest 10 observations that occurred 2 years before original observation using ArcGIS Pro ModelBuilder?

I have a point sample of house sales (~42k points over 9 year period) with a date field(integer), and for each point I want to find the 10 nearest houses within a year of sale and also which were sold ...
1
vote
1answer
60 views

How to get Memory layer dispalyed in Vector Panel List using Pyqgis?

I have two point layer in my Project Centroid.shp and Nodes.shp.I have used Distance Matrix to find nearest Nodes point from Centroid Point. I have saved the output in FinalDistance.csv. The ...
1
vote
1answer
267 views

Error creating DEM with Nearest Neighbour tool in QGIS?

I have an issue when I am creating a DEM with the tool natural neighbour on QGIS. When I extract my data directly on Qgis I have no issue creating a DEM. My points are coming from different sources ...
2
votes
1answer
67 views

Neighborhood Analysis with ArcGIS Spatial Analyst to Calculate Percentage

I have a raster file where the cells (1 meter) are classified as 1 (forest) and 0 (non-forest). I would like to create another raster (1 meter) where each cell is given the percentage of cells within ...
4
votes
2answers
2k views

Combining st_join with st_nn to include all points within, as well as within a given distance of a polygon

This is a follow up to my earlier question (Spatial join in R - Adding points to polygons with multiple corresponding points). I have successfully joined a spatial points file to a polygon file in R ...
0
votes
1answer
397 views

Nearest Neighbor - return object ID in R

I have a csv file that contains the GPS coordinates of about 100 villages and their unique ID. I have an other csv file with the GPS coordinates of some potential destinations and their unique ID. I ...
0
votes
0answers
58 views

PostGIS - Nearest Neighbour Join to sum values

I have a table of polygons T1 and a second table of points P1 Each point has a value I want to sum the values of P1 for each T1, with P1 being the closest set of points to T1 At the moment the only ...
1
vote
1answer
510 views

Find the closest Point from a Point which contains the same attribute

I am trying to create python code to iterate through points on 1 layer and find the closest point on another layer (Road Chainages) based on attribute values. I need to limit the search to < 20m ...
2
votes
1answer
1k views

Nearest Neighbor Analysis Results

I'm fairly new and entirely self-taught in using QGIS 3.4. I'm looking at turtle nest sites and trying to run a nearest neighbor analysis to analyze their distribution and establish whether or not ...
1
vote
1answer
1k views

Spatial join attributes based on closest point in PostGIS

I have two point tables from which I want to extract a value from one table to the other, based on the nearest distance of those two points. t1 t2 id | value id 1 | 100 1 ...
2
votes
1answer
96 views

How to find the closest stop point PostGIS

I have Point geometries created from lat,lon I loaded all the 10,000 stops in a certain city using gtfs i would like to query my db to find the closest stop reference to my point. the staypoint ...