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
4
votes
1answer
137 views

Faster way to find nearest neighbors with LASlib?

I'm using LASlib to find the nearest neighbors of a subset of points in a point cloud. I'm using brute force to find nearest neighbors, which is extremely slow (my code below). Is there a better way,...
3
votes
1answer
420 views

Finding the nearest line to a point in QGIS,but Not Work

I saw Finding the nearest line to a point in QGIS? I wanted to create a program to get the line closest to the selected point. Here is the code. dPos = mouseEvent.pos() qpoint = ...
5
votes
3answers
502 views

Clustering neighboring points inside ArcGIS Desktop?

I am using ArcGIS Desktop 10x. I have a shapefile of 300 points which I need to make groups, each of which will contain exactly 9 points which are closest neighbors. I tried the 'near' tool, ...
0
votes
2answers
116 views

Loop to caculate NNI with spatialEco

In R, I need to calculate the nearest neighbour index between the relocations of a single animal, for several different individuals. I want to determine whether the relocations of certain individuals ...
1
vote
0answers
259 views

QGIS Nearest Neighbor Analysis on Layer Subsets with User Defined Area

I have a data set of developments of various types in a single US City. My aim is to run a nearest neighbor analysis for each of the various development types to explore how clustered, random or ...
9
votes
1answer
209 views

Finding closest line given 2 points using PostGIS?

I have a table t that contains a column line_positions which is of type line. Given 2 points I want to find the closest line that is close enough (less than 10km) and that does not pass too close to a ...
0
votes
0answers
58 views

Sampling Points and Areas around them

I have some coordinates in QGIS. I want to sample the values corresponding to those coordinates on a layer. I know that I can do that for the exact point using 'Point Sampling Tool'. Is there also a ...
1
vote
1answer
301 views

Slow execution of request for searching nearest street to GPS point

I use OSM data. I need to find nearest street for GPS point. I wrote next SQL query: SELECT osm_id, name, ST_DISTANCE(geometry, ST_SetSRID(ST_POINT(37.72308, 55.47957), 4326), true)...
2
votes
0answers
144 views

k nearest neighbour with count limit

I have a set a points, and I want to create 10 clusters. I used attribute based clustering plugin, which worked well for creating the clusters, but the points count isn't perfect, some clusters have ...
1
vote
1answer
154 views

Finding the side of a square that a point intersects with R (sp)

I have a point and a square polygon. Both are sp classes. The point intersects one side of the polygon, and I need to know which side of the square it intersects (i.e. north, east, south, or west). ...
2
votes
0answers
180 views

Finding the closest points to a line with only one point from each subset of points

I have a set of data points that represent many paths for different journeys, where each journey has its own identifier (Operation No). The data for all journeys is in a single table but in effect has ...
2
votes
2answers
161 views

Classifying neighbors AND neighbors of neighbors using ArcGIS Desktop?

In ArcGIS 10.2, I'm trying to identify the neighbors AND neighbors of neighbors for counties in the United States. Although I can identify which counties are neighbors to each county using either a ...
1
vote
1answer
274 views

ArcMap Calculate Average Nearest Neighbor - failed

I am trying to determine the mean and standard deviation from a subset of point features. Once I determine the standard deviation I want to exclude any points that are more than twice the standard ...
2
votes
1answer
625 views

How to get distance values from nearest neighbor query for 5 closest features to multiple records in PostGIS?

I found this query on this blog https://geeohspatial.blogspot.com/2013/05/k-nearest-neighbor-search-in-postgis.html?showComment=1480796271673#c3250651227513965563 which returns the 5 closest records ...
2
votes
0answers
57 views

Postgis query for nearest neighbor returns distant coordinates [closed]

I have schema for a table called "places" that looks like this with about 6000 rows: name | county| long | lat | the_geom | id Tuthilltown | Ulster | -74.1789 | 41.6843271513 | ...
1
vote
0answers
598 views

NNJoin returns incorrect distances

Bottom Line Issue: The distances I get from NNJoin for the shortest distance from a point to the nearest polygon are several hundreds or even thousands of meters shorter than the distance I calculate ...
5
votes
1answer
244 views

Postgis Distance calculation on huge datasets

We have 7,512,694 records in our table, Columns: id, name, lat (numeric), lon (numeric), location (geometry(Point,4326)) Indexes we created: create index on table using gist(location); and of ...
1
vote
2answers
209 views

Simulating a point pattern under Complete Spatial Randomness in R

As per title, I am trying to figure out how to simulate such point pattern without the use of the 'spatstat' package (which I cannot install due to the old version of R which I am using, which in turn ...
7
votes
1answer
1k views

PostGIS / OSM: Faster query to find nearest line of points

Following scenario: I have a table roads, which basically contains the road network of a whole country extracted from the OSM line table and a table points containing millions of GPS tracked points ...
6
votes
2answers
1k views

distance matrix with a linear feature

I would like to use the distance matrix tool (or a similar function) to look at distances between sites (displayed as point data) and large rivers (displayed as linear). I have been following this ...
1
vote
1answer
161 views

Nearest Neighbor distance frequency distribution

I have a dataset of 6455 points. Is there a way to produce the frequency distribution of nearest neighbour distances in the data set in ArcGIS 10.3? The Average Nearest Neighbor tool only produces the ...
1
vote
0answers
45 views

max sum within a 200mt radius

I have a SpatialPointData Frame in R. Each point represents lat long and InsuredValue amount. I would like to find the maximum sum of insured value in a radius of 200 mt. How I can do in R
6
votes
2answers
3k views

Calculating distance between points of same layer using QGIS?

I am using QGIS 2.13 and a layer with hundreds of points. I need to calculate the distance to the nearest point... in the same layer. I tried the distance matrix but I get 0m since the "closest" point ...
2
votes
1answer
167 views

Nearest neighbors

I have a point shapefile overlayed over a grid-based polygon shapefile. I would like to select the nearest neighbor grid cells of a given grid cell that contains any of the given point(s). So let's ...
1
vote
1answer
95 views

Finding nearest point using point dataset using QGIS?

I have created Geocode for some area and I couldn't find accurate Geocode's for few address. so I want to find the nearest POI for non accurated locations using accurated geocodes as referece in QGIS. ...
1
vote
1answer
509 views

Optimizing PostGIS k-nearest neighbour function for large amount of polygons?

I created a function for identifying the K nearest neighbours for every municipality, which works fine, but when I use this function for a large amount of municipalities (over 2900) it takes over 2 ...
0
votes
1answer
605 views

Finding neighbors for non adjacent polygons in R [closed]

I'm looking for a method or function in r-project that create a neighborhood matrix from a group of polygons that don't touch each other, like polygons of set of blocks separated by streets in a town. ...
1
vote
1answer
201 views

Nearest Neighbor Analysis for route events

I have events that are on routes. You can think of it as accidents on a highway. I want to do some spatial statistics on it. The road is an M enabled feature class and decision makers want logical ...
1
vote
0answers
91 views

Applying Edge Correction in ArcGIS Average Nearest Neighbor?

I am using ArcGIS 10.3 with the tool Average Nearest Neighbor from the Spatial Statistics toolbox to describe the data. I want to avoid mistakes caused by Edge Effect. In the Ripleys K Function tool ...
1
vote
1answer
112 views

Average Nearest Neighbor does not have all the options

I have a point feature class that I used the Average Nearest Neighbor from the ArcGIS software to calculate the pattern. ArcGIS produces output chart that says whether the data is dispersed, random ...
0
votes
1answer
72 views

Average Nearest Neighbor tool extreme restuls for different area?

I'm using the "Average Nearest Neighbor" tool in ArcGIS 10.3 to calculate whether my point feature class is clustered, random or dispersed. One of the parameters is area. I tried putting different ...
1
vote
0answers
32 views

When would I use K analysis over NNA?

I'm working with the dataset Redwood (62 redwood trees in a 23^2m square). I intend to test whether these are random or not. In what cases would I prefer Nearest Neighbor Analysis and in what cases ...
3
votes
1answer
177 views

Nearest neighbor analysis, write multiple columns to table

I have a table (table1) containing 800 points that I want to join with a table (table2) containing only 10 points. The idea is that the points in table2 are assigned to the points in table 1 based on ...
2
votes
0answers
41 views

Setting vector area

I'm new to QGIS and am using it to spatially analyze the placements of artifacts within an excavated site. I am trying to conduct nearest neighbour analysis; however, I do not know how to set the area ...
4
votes
1answer
1k views

What algorithm does QGIS use to calculate Nearest Neighbor Index?

I'm carrying out nearest neighbor analysis on a set of geological features in QGIS, trying to find out whether they're clustered or not. I've calculated the nearest neighbor distances using the '...
2
votes
0answers
97 views

Choosing interpolation method for monthly atmospheric parameters derived from AQUA/Air satellite?

I want to investigate atmospheric refraction and i am using Aqua/ Airs satellite data. These are atmospheric parameters (1) Air temperature (2) Geopotential height (3) Relative Humidity All these ...
1
vote
1answer
823 views

Nearest Neighbour function

I'm trying to create a function which calculates the nearest neighbors under a certain length in a table s_1 an stores them in an output table. This is what I've got so far: CREATE OR REPLACE ...
1
vote
0answers
87 views

Coordinate System choice for Nearest Neighbor

Here's an interesting scenario I came upon yesterday and I wanted to throw it out as a question to try help me visualize what is happening. I have a single point (a person, say) who is looking for ...
1
vote
1answer
72 views

Append near tables, error message

I have 50 near tables that I want to append, so I can export them at once. However, when I use the append tool an error comes up saying that the near tables are 'read only'. Is there anyway to make ...
1
vote
1answer
169 views

Get all streets within a certain radius with osm2po

I'm trying to get all street segments out of osm2po graph, given a geo point and a certain radius. Right now I just do a breadth first search out of the street that's closest to my point, but is there ...
1
vote
0answers
592 views

Using spatial index in spatialite query?

I posted this question originally Using nearest neighbor query in SpatiaLite? Using the answer given I was able to get the query working on some test data. However I am having trouble applying a ...
4
votes
2answers
1k views

Using nearest neighbor query in SpatiaLite?

I am trying to find the nearest line to each point in a layer, and I have over 1 million points. I want to be able to associated the closest unique line ID with the point unique IDs. I have tried to ...
0
votes
2answers
225 views

Spatial join geotagged images to preexisting point shapefile? [closed]

I have a layer of geotagged images (points with jpg thumbnail attachment), and another layer of different points (shapefile with various attributes). I would like to perform a spatial operation in ...
2
votes
2answers
2k views

How to create a line between a point and nearest neighbour using python (template included) [closed]

I have 2 shapefiles - one is a series of points, the other is a polyline. I want to draw a straight line between each point to the nearest point on the polyline. This question has already been asked ...
1
vote
1answer
284 views

Number of Neighbors Around a Point

I need to get a count of neighbors within 100m for each point in a set of 250 million points. The result would have the id of each point accompanied by the number of neighbors around them. Can this be ...
1
vote
0answers
127 views

Why would Nearest Neighbor Analysis give 0 observed mean distance?

I am working with small datasets (around 100 points or less) with Nearest Neighbor Analysis in QGIS 2.8 (although I also tested in 2.6 and the result is the same). I have the layers referenced with a ...
0
votes
2answers
768 views

Neighbors within distance from every row

I have a research project of 180,000 entries and I need to calculate the number of neighbors (points from the same table) that exist within a 300 meter radius for each point. My method is very slow, ...
20
votes
4answers
24k views

PostGIS nearest points with ST_Distance, kNN

I need to obtain on each element on one table the closest point of another table. The first table contains traffic signs and the second one the Entrance Halls of the town. The thing is that I can't ...
0
votes
1answer
595 views

Saving samples in eCognition

In eCognition developer is it possible to save samples that I have selected for nearest neighbor classification with the workspace or project? Every time I close and reopen my project I have to re ...
1
vote
1answer
180 views

KeyError: u'M' in Average Nearest Neighbour test

When I try and run the Average Nearest Neighbour test on my Shapefile I get the error: KeyError: u'M' Failed to Execute (AverageNearestNeighbour) On a "normal" Shapefile this works fine. However I'm ...