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
0 answers
18 views

Spillover Binary variable based on neighboring cell in R

I would like to create a binary variable 'Spillover' that equals 1 for a particular cell (gid) if an incidence event occurred in any of its neighbouring cell in the previous year to account for ‘spill-...
user avatar
  • 31
0 votes
2 answers
52 views

Any Python modules with an equivalent to ArcGIS Pro "Average Nearest Neighbour Distance" tool?

ArcGIS Pro offers the Average Nearest Neighbour Distance geoprocessing tool to measure the distance between each feature centroid and its nearest neighbour's centroid location. It then averages all ...
user avatar
3 votes
2 answers
114 views

Looking for Python equivalent of QGIS "Nearest Neighbour analysis" tool

I've been using QGIS "Nearest Neighbour analysis" tool to find out the following information about my point shapefile Observed mean distance Expected mean distance Nearest neighbour index ...
user avatar
2 votes
1 answer
51 views

Distance to nearest shape in Python

I have a shapefile containing multiple polygons of protected zones, I try to compute a raster with, for each pixel, the distance to the nearest protected zone. I've been able to obtain it with QGIS ...
user avatar
  • 39
1 vote
1 answer
38 views

Identifying n-nearest polygons to point in GeoPandas

I have a dataset of fire polygons, and a user inputted lat/lon coordinate. I'm hoping to write a function to subset the 3 nearest polygons to the inputted coordinate, in order to report out their ...
user avatar
2 votes
1 answer
66 views

Aggregate points inside polygons

I have a project that I am required to aggregate points inside polygons that have a common value. Basically having QGIS to create a buffer around those points. The dark green arrows have a unique ...
user avatar
  • 21
2 votes
1 answer
86 views

QGIS georeferencing leads to wrong position

I'm trying to georeference a TIFF file in QGIS (version 3.20.0-Odense) based on a WMS layer (EPSG:4326). The project is in EPSG: 25832 and I used the same as output for the georeferencing (4 points, ...
user avatar
  • 21
1 vote
0 answers
25 views

Categorical raster values to points are incorrect near edges

I have a vector point layer, and a low-res, categorical raster. The raster is a map of habitat type, and it is in the form of a single-band which ranges from 1-55 where each number is a different ...
user avatar
  • 29
3 votes
2 answers
175 views

QGIS pick up certain value from the nearest neighbour object

I have a set of addresses defined by the green dot. I have also objects (poles) to which I would like to assign the address (3-4 data attribute columns) from the nearest address point (green). I ...
user avatar
  • 3,594
1 vote
1 answer
91 views

Calculating average attribute value of neighbour grids based on location and applying it to grid cells in QGIS

I have a grid dataset of 2.5km grid-cells and want to calculate the average of some attributes for each of the eight adjacent cells to the central one (nine cells forming a square). So the calculation ...
user avatar
1 vote
1 answer
70 views

Difference between SDO_NN and BallTree Sklearn for Nearest Neighbors

I am trying to find nearest n/w nodes from multiple buildings in an area, I have 2 geodataframes/Tables in Oracle DB, buildings have point geometries with ID's and Nodes have point geometries with ...
user avatar
  • 111
2 votes
3 answers
195 views

Get nearest neighbour on same or another layer to connect points by drawin a line in QGIS

In my project I try to find the shortest way from a point to a specific line (street). Fortunately, this is no big deal in QGIS 3.0 using "Points along lines" and "Distance to Nearest ...
user avatar
  • 23
2 votes
1 answer
424 views

Fastest way to extract the neighbours of a GPS point among millions of other points?

I have millions of GPS point located in the same city. I would like to make spatial bins that contain adjacent points together (GPS points that are within a specific range of each other). I have a ...
user avatar
  • 29
0 votes
0 answers
26 views

Reverse-engineering a drivetime map

I recently came across a map on a Reddit site showing the closest MLB stadium by drivetime across the US. I've seen maps before that show a polygon around a point that represents a given driving ...
user avatar
  • 375
0 votes
0 answers
31 views

Iterating over two very large dataframes: finding the closest LineString (1/150k) to a Point (1/1.2m)

I have a dataset of calls (1.2m rows), each with a 'Point' geometry. Likewise I have a street dataset (150k rows), each with a LineString geometry. My goal is to identify, for each call, the closest ...
user avatar
2 votes
0 answers
56 views

Depth To Water Index - How to Extend the Wetland Boundary Based on Parameters

I recently reached out to ask about how to develop a Cartographic Depth-to-Water index (DTW) following the methods described in the paper below: Using the Cartographic Depth-to-Water Index to Locate ...
user avatar
  • 365
2 votes
0 answers
29 views

QGIS Field calculator preview is different to field value when identifying neighbor polygons to list and count in attribute field?

I am using Field Calculator to identify neighboring polygons and count them. However, the Field Calculator preview value is not the value going into the Attribute field (as per images), unless only ...
user avatar
1 vote
0 answers
31 views

GeoPackage: Nearest point from another table

I'm trying to use GeoPackages rather than PostGIS when teaching introductory classes, and that inevitably involves conversions between SQL variants. This time, I'm not able to get to a version of a ...
user avatar
  • 2,751
4 votes
1 answer
202 views

How to assign a neighbour status to unlinked polygons

This question is, in part, a follow up to: https://stackoverflow.com/questions/57269254/how-to-impute-missing-neighbours-of-a-spatial-weight-matrix-queen-contiguity I have a .shp similar in structure ...
user avatar
4 votes
4 answers
263 views

How to find neighboring polygons which share a common feature in ArcMap 10.4?

I am currently using ArcMap 10.4. My task is to find which polygons share a border given a specific feature. I would like to automate this workflow. For instance, I have 2 polygon feature dataset (...
user avatar
3 votes
1 answer
79 views

Nearest neighbor analysis to pick the next closest waypoint

I'm looking for a QGIS solution to do a nearest neighbor analysis on a set of waypoints that I have as X Y points. When the points are loaded into the planning software (loaded as waypoints) they draw ...
user avatar
3 votes
2 answers
60 views

Clustering vectorpoints

I created a layer of vector points out of a raster. The raster was a .png, where I extracted all the pixels with the value 1. Initially, it was a Paper, where I marked points with a pen. Now I am ...
user avatar
  • 55
4 votes
1 answer
120 views

ST_DWithin is returning all the data in the table

I am new to PostGIS and currently struggling with ST_DWithin function. I have a table stores, which stores lat and long of locations in Denmark in the location column as geometry and with SRID 4326. ...
user avatar
2 votes
1 answer
181 views

QGIS spatial analysis grid nearest neighbour ERROR 4 No such file or directory Process returned error code 1

Whenever I try to run some form of spatial analysis by raster>>analysis>>Grid (Nearest Neighbour) or Grid (Inverse Distance to a Power) I am hit with the errors and message logs below. I ...
user avatar
0 votes
2 answers
70 views

What tool do I need to visualize world map with straight border while keeping its area and neighboring countries

I am fairly new to data visualization. My goal is: Turning country area into right angled polygon with same area Keeping the neighboring country tangent to its new border Finding the new arrangement ...
user avatar
0 votes
0 answers
12 views

Raster analysis in R - getting value of nearest target cell

i am currently doing some Raster analysis in R (including Postgres/PostGIS connection). I have a rastered Linestring and created a distance raster around it via raster::distance I have two more ...
user avatar
1 vote
1 answer
121 views

The distance between the points of two layers

I have 3 layers in QGIS (shapefiles) : two point layers : Houses and fire hydrants and one line layer : Road I want to calculate the shortest distance between each fire hydrant and a house using the ...
user avatar
  • 13
0 votes
0 answers
21 views

Finding Average Nearest Neighbor when multiple points are stacked with similar XYZ

I routinely run the average nearest neighbor tool in ArcGIS Pro but I do a lot of front end massaging my points file. My current workflow: I generate multiple points that run down a single drill hole ...
user avatar
  • 56
2 votes
1 answer
54 views

Duplicates Not Highlighted

Actually I am using Geometry Generator and a small script for displaying duplicate values in the data. But some duplications are not highlighted. Don't know why its happening. can any one suggest any ...
user avatar
  • 259
2 votes
1 answer
239 views

replacing missing values with the most common pixel closeby [QGIS]

Hi I made classification map which you can see below. Because the original map had text in it and some borders etc that I didn't want to be included in the new map, these got their own class and ...
user avatar
  • 23
0 votes
1 answer
128 views

QGIS Nearest neighbour analysis with GeoTIFF

I need to perform something similar to the ArcGIS tool for neighbourhood analysis (Toolbox>Spatial Analyst Tools>Neighorhood>Focal Statistics). But for nearest neighbor in QGIS I need a ...
user avatar
  • 85
2 votes
1 answer
74 views

Find nearest neighbour for set of points [duplicate]

Using PostgreSQL and PostGIS. I have two sets of point data (geoms), one is a node graph indicating roads and the other represents street crossings. For my set of crossing data I want to find the ...
user avatar
3 votes
1 answer
134 views

Setting the study area boundaries in QGIS for nearest neighbor analysis?

I've made a cursory (i.e., two hour) search of the Stack Exchange and the Internet to find out how we can set the study area boundary for the nearest neighbor analysis command in QGIS 3.16. Sadly, I ...
user avatar
1 vote
1 answer
279 views

Cell size in Grid (Nearest Neighbour) in QGIS

I am using Grid (Nearest Neighbour) in QGIS to obtain raster layer from point shapefile. However, on execution of the tool and obtaining the output, the default resolution of cell is 62 m. However, I ...
user avatar
0 votes
0 answers
19 views

How print nearest object?

I have point on map. I want found nearest object. Code works perfect. System show 1 occurence. But how get it? point = arcpy.Point(5285360.478599999, 5310336.491400003) ptGeometry = arcpy....
user avatar
0 votes
2 answers
32 views

v.surf.idw failling with "Killed" message on GRASS 7.8.2

I have a categorical raster with gaps that I would like to fill using a nearest neighbour interpolation. The r.fill.gaps module does not implement this interpolation method so I am trying a manual ...
user avatar
1 vote
0 answers
17 views

Adding nearest point-(features) to attribute table

Using QGIS I'd like to add the (10) nearest random points, that I created within a polygon, to a target point and have their distances to said point added to that point's attribute table. I'd like to ...
user avatar
  • 59
4 votes
1 answer
71 views

Label neighbouring features in QGIS

In QGIS I'm trying to label the neighbouring features of a certain polygon but not getting much success. All the features are inside the same layer named MG_Municipios_2020. I'm using the Rule-Based ...
user avatar
  • 1,054
0 votes
1 answer
31 views

Composite layer by distance

I've got a complicated problem right now. I have a layer with polygons and use the tool "Closest Neighbor" to find all Polygons that have a neighbor within 10 meters. That works fine, but ...
user avatar
1 vote
1 answer
106 views

Highlight duplicates at nearest distance

I have a point shapefile with several names and there are a lot of duplicate names in the data. I want to highlight the nearest duplicates in the data. How can I solve that in QGIS?
user avatar
  • 259
-2 votes
1 answer
57 views

How do I use my points to create Nearest Neighbors Clusters Map? [closed]

I have points which I am trying to analyse using visualist tools in QGIS and I am an encountering a common error ( see attached image ). How best can I rectify the problem? Tried several times to ...
user avatar
1 vote
0 answers
99 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 ...
user avatar
1 vote
0 answers
60 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 ...
user avatar
  • 11
0 votes
0 answers
46 views

Finding for each point-feature in layer nearest point in other point-ayer over 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 ...
user avatar
8 votes
3 answers
1k 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 ...
user avatar
5 votes
1 answer
185 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. ...
user avatar
  • 73
0 votes
1 answer
24 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 ...
user avatar
2 votes
1 answer
560 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 ...
user avatar
4 votes
1 answer
78 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 ...
user avatar
2 votes
0 answers
311 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 ...
user avatar

1
2 3 4 5