# Questions tagged [distance-matrix]

a distance matrix is a matrix (two-dimensional array) containing the distances, taken pairwise, of a set of points.

178 questions
Filter by
Sorted by
Tagged with
40 views

### Finding shortest road distance between points on two datasets QGIS [duplicate]

I have two point datasets: Communities and Vet clinics I am trying to find the nearest distance between each community and the closest vet clinic, but would ideally like to link this to a roads ...
31 views

### Use TomTom Data as Network Dataset to Calculate OD Cost Matrix Distance and Time

I am stuck in with configuring a network dataset using TomTom data. I used to rely on the Routing_ND network dataset provided by ESRI Business Analyst to perform OD Cost Matrix analysis. Now I am ...
57 views

### Calculate distances between all point features in one layer and all point features in another layer (NOT only nearest)

I would like to calculate distances between all point features in one layer and all point features in another layer using ArcGIS Pro 3.1.2 tools or ModelBuilder. I'm not looking for distance to the ...
• 155
91 views

### PostGIS min and max distance between bounding boxes

I've been exploring the capabilities of PostGIS get the minimum and maximum distances between bounding boxes. --returns distance between centroids select ST_GeomFromText('LINESTRING Z(0 0 0, 1 1 1)') &...
• 53
123 views

### Calculating large travel distance matrix

I need to calculate a really large travel distance matrix 3600^2 to solve a TSP problem between points. I have the coordinates of the points and also the addresses. How can I calculate this matrix ...
485 views

### st_distance() hangs with large number of points in R

I am using sf::st_distance() to calculate a distance matrix in R. I have around 30,000 polygons, and I am running this analysis on a computing cluster with ~500G of RAM. I understand that 30,000 ...
274 views

### Faster way to compute Moran’s Index from a very large distance matrix between geographic points

I am computing Moran’s Index from a very large distance matrix between geographic points. The time to execute the code is too high. I used the dism function in the geosphere package. Here a ...
• 395
59 views

### Calculate distance matrix in km units not degrees

I need to calculate the distance of England crimes to the Uk coast. I have a shapefile of the outline of the coast and extracted the vertices. So then I can input the crimes to the coast in distance ...
62 views

### QGIS Distance Matrix - line geometry output between two input point layers

I am trying to figure out how @AJIKenyon took the expression in this post (QGIS Distance Matrix - with line geometry output?) and used it in Geometry by expression. The layers I have are two projected ...
• 57
46 views

### Calculate network distance from point layer to Hub layer in QGIS

I have a river network layer, a layer of 360 sampling sites and a layer of 700 facilities. I want to calculate the network distance only between sampling sites and facilities but between all sites and ...
• 33
36 views

### Distance Matrix won't consider elevation

Using QGIS Firenze The Data is present in following Formats: .gpx, .kml .csv. generated by garmin GPS. lat, lon (In Degrees) and elev (in m). There I have 70 Points. I can create a distance matrix or ...
1 vote
296 views

### Interpreting total time variable in QNEAT 3 OD Matrix using QGIS

In QGIS 3.26.1, I used the QNEAT3 "OD Matrix from Layers as Table (m:n)" function. (Ancillary info: I am using the TIGER/Line 2019 primary and secondary road data for the US, in order to ...
• 21
1 vote
86 views

### Keep only one nearest OD link (QNEAT)

I've made a distance matrix from one point layer (layer A) to another (layer B) using QNEAT plugin (QGIS Network Analysis Toolbox 3). I got a web with links from every point from A to every point from ...
1 vote
159 views

### Create grid around lat/lng with same spacing on the diagonal points using SQL Server

As an example I have a lat/lng circled in red below. I want to create a grid of points using SQL Server at 50m intervals up to 200m from the centre point. But those points that are on a diagonal are ...
• 165
30 views

### What is the method behind calculating a distance matrix?

Do you know if for the creation centroids or nearest distance (or whatever) is used? How do I know what is happening? Couldn't find anything specific in the documentation.
127 views

### Is there a specific function within Network Analysis - OD Cost Matrix that solves for connectivity issues?

I am calculating the distance between points along a network dataset of roads. However, I am running into issues as some of the points do not align along the road network. I have attached an example ...
• 3
1 vote
83 views

### Distance matrix not giving nearest point in QGIS [closed]

I'm having a bit of trouble with my procedures in QGIS Desktop 3.22.6. I bring in a shapefile for the entire US block groups into QGIS. I then bring in points of stores across the U.S. I then use the ...
• 29
219 views

### QNEAT3 OD Matrix distance incorrect?

I am currently working on calculating the distances between all pairs of NUTS-2 regions in a road network. To accomplish this I am using the QNEAT3 plugin. It worked very efficiently and I was ...
• 51
1 vote
63 views

### Find closest distance every day in two datasets

My friend and I want to use our exported Google Location data to see how close we've been, at the same time, before becoming friends. In other words: I have two datasets of timestamped coordinates, ...
• 19
5k views

### Distance between two points on OSM without routing information

I need to find the distance between multiple points following roads on OSM. I am aware of routing software like OSRM. However, this is not a useful solution for me (at least the alternatives I've ...
695 views

### Number of points within x min walking distance in QGIS

In QGIS I have a layer of points each one representing a household with its (x, y) coordinates and a population assigned to them. I'd like to calculate the points that are accessible from each point ...
• 21
150 views

### QGIS - Calculating point-line distances on a bearing from multiple points simultaneously?

I'm working on a wildlife study, and hoping to calculate the distance from each of our trail camera locations to the nearest road in eight points of the compass. I used the Shape Tools Plugin to ...
123 views

### Recalculating distance table - is there fast (fast and dirty OK) way?

I have a system that is based on PostGIS that holds a set of coordinates. It serves a lot of user requests where users send their own current coordinates and receive a set of points that are located ...
887 views

### Calculating distance between consecutive points in same point layer in QGIS

I have a point layer with close to 60.000 points that depict a river course (pixel extracts from satellite image). CRS of the layer is Geographic (Lat, Long). The pixels are ordered ascendingly from ...
• 77
224 views

### Measuring minimum distances for closest features between two polygon layers in QGIS

I am trying to find a way to measure minimum distance between two polygon layers in QGIS. I have one polygon layer (orange) which represents hunting areas, and one polygon layer (green) which ...
104 views

### QGIS QNEAT distance matrix - wrong outputs

The data and the problem I started to use QNEAT in QGIS (after very helpful advice from user Babel, here: Average walking distance). But when I was trying to pull some nice maps out of it, I noticed ...
• 535
1 vote
360 views

### Error when calculating an OD Matrix using QGIS QNEAT?

I was using QNEAT plugin for QGIS just fine after some very thoughtful recommendation on this web. The first time all went well, but I needed to redo it. Now when I try it I get an error. I can use ...
• 535
125 views

### MultiPolygonZ to nearest line using a road network (or: how far is the next highway from a project site?)

I have a MultiPolygonZ layer of Project Sites (ca. 700 features, mostly 1 polygon per feature) and want to get the shortest distance on a road network to the nearest subset of a line layer, e.g. the ...
• 63
155 views

### QGIS OD matrix with option to chose maximum number of destinations and max. distance

Using QNEAT3 plugin in QGIS, you can create OD Matrix from Layers. The ArcGIS documentation about OD cost matrix analysis mentions a TargetDestinationCount as well as a Cutoff_[Impedance] setting to ...
• 73.8k
771 views

### Aggregating features values based on distance in QGIS

In a polygon dataset, I try to summarize values of surrounding features based on a minimum distance if their area is too small (e.g. 500 square meters). For example, I have 3 polygons with 300, 250 ...
• 1,482
309 views

### Does Geometry by expression in QGIS except layer without geometry?

There is distance matrix with 9.455 features without geometries in GeoJSON format. It was created outside of QGIS with a tool similar to QGIS's "Distance matrix". The matrix looks like this: ...
• 33.7k
418 views

### Calculating minimum distance between points in QGIS

I hope to calculate the distance between each property in the Washington DC metropolitan area and the nearest metro station, and I am doing this for each month from 2000 to 2017. I use Distance Matrix ...
• 29
297 views

### Find and delete duplicate rows in matrix in QGIS 3.6

I used the OD Matrix to produce a list of the distances between all sites to all other sites via a network. This process produces duplicates, since it makes calculations in both directions, i.e., from ...
912 views

### What unit is represented by OD Matix costs (in QNEAT3 within QGIS 3.6 Noosa)?

Some background to explain what I have done, and thus my current question (at the end). I am trying to find a way to get a list of the distances between sites of a certain class to the nearest site of ...
3k views

### Calculating road travel distance between point and polygon layers [closed]

I am trying to calculate the top three shortest distances from a point file (buildings) to a polygon file (designated natural areas) via road networks. I basically need the "Join attribute by ...
• 39
1 vote
390 views

### How can I calculate the distance between multiple points in a network?

I have multiple points on multiple lines in a network and I need to know the length between these points along the network. I need an OD matrix, like the QNEAT3 distance matrices but for the distance ...
• 23
1 vote
140 views

### QGIS distance between centroids from NUTS1 information

I have calculated the centroids from NUTS1 information. Now for every neighbor centroids, I would like to calculate the distance. I want to connect only the neighbor's Centroids regarding the NUTS1. I ...
538 views

### Pairwise shortest distance between points in a road network

1. Problem I have the coordinates for over 5000 points (cities) that lie over a road shape file, as partially illustrated below: I'm working on R, and I need to find the shortest distance between all ...
1 vote
36 views

### Modeler - QNEAT3 - selected destinations instead of "all origins" to "all destinations"

I would like to calculate the distance between points from table A (80 000 entities) , to points from table B (500 entities), filtering with a relation parent-infant (or just using a common field ...
• 301
1 vote
97 views

### Unusual QGI3S "Exception: Unkowns"

I'm trying to process some OSM data extracted via Osmium. I've managed to process some of my smaller datasets, but as I've begun working on the bigger ones, I'm receiving some odd errors. Specifically,...
1 vote
474 views

### OD Matrix algorithm in QNEAT3 plugin (QGIS)

I have two questions regarding OD Matrix algorithms in QNEAT3 plugin. If I set the cost strategy as the fastest path, would the output be the travel time? If yes, is the output in seconds? The ...
• 419
1 vote
105 views

### Distance and time fields are null in the output of Matrix From Layer algorithm of ORS Tools plugin in QGIS [closed]

I tried to calculate the travel distance and the travel time using Matrix From Layer algorithm of the ORS Tools plugin in QGIS, but in the attribute table of the output, the duration and distance ...
• 419
705 views

### How do I interpret the results from the distance matrix?

In this dataset I have created the green dots represent coyote sightings while the yellow dots represent rabbit sightings. I am trying to determine if coyotes and rabbits are randomly distributed or ...
• 617
2k views

### Why is SQL Server 2019's STDistance Very Slightly Different Than The Vincenty Formula? (Same Up To ~0.0001km)

I'm trying to make a C language equivalent to STDistance. Through research, I've narrowed down what STDistance uses, which apparently is the (inverse) Vincenty Formula. The problem is, I've tried ...
• 113
1 vote
143 views

### Improving PyQGIS distance matrix efficiency

I have written a custom processing tool, which I use within a large graphical model in QGIS. I am looking for a way to speed it up. First step of this processing tool is to connect every point of one ...
• 35.2k
122 views

### Include ID in an spatial weight matrix R

I have a data frame like this one: dataSp <- read.table( text = ' ID LATITUDE LONGITUDE A -85 134 B 34 2 C 42 3 D 45 ...
240 views

### Terrain aspect similarity

I have a point data set with terrain aspect at the location of the points, measured in degrees. I want to compute the similarity of aspect between the points, e.g. 70° is similar to 90°. This is ...
• 571
1 vote
42 views

### Incorrect Routing Times in ArcGIS Desktop 10.7

I'm trying to find an OD Cost Matrix for a sample of zip codes in LA, San Bernardino, and Clark (NV) Counties using TIGER Data found here: https://www2.census.gov/geo/tiger/TIGER2012/ROADS/ (the files ...
• 11
1 vote
77 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 ...
• 13