New answers tagged

6 votes

Calculating distance between two closest points on graph in QGIS

Solution 1: Beeline distance Use distance matrix tool for a quick and dirty solution: ignoring the network, just beeline distance (for using network, see below). At least from your screenshot, this ...
  • 54.6k
1 vote

Find Euclidean distance based on cell size

In this specific case, given cell size 20 and measuring distance to/from the centre of the cells: x=20 y=60. Therefore: d=63.245 This is a specific answer, to solve for other cases we need to know ...
  • 2,418
1 vote

Determining locations that contain multiple raster attribute types within a set distance

This can be solved using the Focal Statistics tool, here is some ESA landcover data: Run it through Focal Statistics, using the Variety type as shown below: You get this: Each pixel is recording ...
  • 41.1k
0 votes

Calculating distance to points in QGIS

To add to this, I used Create Constant Raster Layer to make the raster with the pixel size and extent I wanted in the output (and a constant value of 1) In the points layer I created a attribute ...
2 votes

How can I calculate the nearest 3D distance (x, y, z) between points in Qgis?

Export your layers to a Spatialite database (right click - Export - Save feature as) Connect to the database in Database manager: The query below will join the road table to the forest table and find ...
  • 60.6k
0 votes

Distance between lat/long points

There is a general purpose function available on You can calculate distance in any units and you can decide if you want a great-circle or rhumb-line method It's ...
  • 1
0 votes

Find the distances between stores with Lat/Long Coordinates in Python

You could use something along those lines: select a.someid ,MIN(ST_DISTANCE(ST_MAKEPOINT(a.store_longitude,a.store_latitude), ST_MAKEPOINT(b.store_longitude,b.store_latitude))) AS Distance ...
  • 474
0 votes

How to measure the distance between two points in the same layer accounting for stream meandering in ArcGIS Pro

Although flow lines are a natural use-case for linear referencing, building a linearly referenced data set isn't trivial. In this specific case, it isn't necessary so it definitely isn't worth the ...
  • 1,583
0 votes

Math error when trying to calculate the distance between two coordinates in python

So, after more checks (and a bit of arithmetic), calculating the distance between two identical points should simplify to calculating the arccosine of 1, which is 0. Due to a float rounding error, and ...

Top 50 recent answers are included