Questions tagged [distance]

The measure of separation between two entities or locations that may or may not be connected, such as two points.

Filter by
Sorted by
Tagged with
9
votes
4answers
29k views

Calculating minimum distance between points and polygons in QGIS?

I have two vector layers: one point and one polygon and I want to calculate the minimum distance of each point from the polygons (ie the distance from the closest point of the closest polygon). Is ...
9
votes
1answer
4k views

How do I perform a proximity search with Postgis?

I downloaded the Geonames database (cities1000) and wrote a small Ruby program to import them into my table (geo_cities). I then added geography column called geog. Then I converted all of the lat/...
9
votes
3answers
3k views

Calculating all distances from single points to multiple polygons [closed]

I have two layers: a point layer defining properties (95 objects), and a polygon layer defining plots of land associated with the properties (211 objects). Each point relates to one or more polygons. ...
9
votes
2answers
1k views

How do I calculate Manhattan distance with PostGIS?

I am using the ST_Distance function to calculate the distance between two geometries (a train station and a building) Since I know that all buildings and all train stations are in Chicago, which has ...
9
votes
1answer
5k views

calculate {minimal} distance between polygons in R

I have calculated the surface area of species distributions (merging polygons from shapefiles), but since this area can be comprised of quite distanced polygons, I would like to calculate some measure ...
9
votes
3answers
2k views

Looking for a fast, open-source raster cost-distance function to use in code

I've been scouring the internet for a fast, open-source cost-distance function that I can embed inside my code. The functionality should basically work like the ArcGIS implementation where I can ...
9
votes
3answers
1k views

New to ArcGIS and want to compute distance between two points “as the fish swims”

We have a layer named Hydrography which is the water area for a given assignment. I have a station point and a target point. I need to compute the distance between those two points but inside of the ...
9
votes
1answer
392 views

Measuring distances between simultaneous points

I am working with GPS data and so I have UTM's with DATE/Time information. I have 2 groups of species (moose and wolves). I want to join the information from moose to wolves that match in time. So, ...
9
votes
1answer
2k views

Analysing movement using cost surfaces with ArcGIS Path Distance tool?

I would like to analyse hypothetical movement (on foot) in a landscape as based on energy expenditure, but I have run into some trouble that I am hoping that you could help me with. I have tried to do ...
8
votes
2answers
43k views

Performing Distance Calculation using Excel?

Is there a way (preferably in Excel) to calculate the distance (based on lat, lon) between two lists of points? My end goal would be, for example, to have a list of Starbucks and a list of McDonald'...
8
votes
5answers
12k views

How to calculate distances in a point sequence?

I'm looking for help calculating the distance between a sequence of points that are in a single Shapefile in QGIS. Below is what my data look like and a blank distance column I've added to show how I'...
8
votes
2answers
15k views

How to find nearest point for each point in current layer using ArcGIS Desktop?

I have a point layer and want to know the distance of nearest point of current layer for each point in the layer. I found some tools in ArcToolbox about it , but they need two layers for input and ...
8
votes
2answers
4k views

Shapely Distance different from Geopy/Haversine

I am running a specific analysis where we use shapely to create buffers around points (store locations) and then check if other points (user locations) are present within that buffer value. When i ...
8
votes
2answers
4k views

Get shortest distance between two geometries in ArcPy

I'm using ArcPy and using a cursor to step through one polygon feature class. For each of these 'source' polygons, I am creating a SearchCursor to find all polygons in a second feature class that ...
8
votes
3answers
947 views

What kinds of line segments/edges require high accuracy in a true surface-of-the-ellipsoid representation?

I've been musing (and doing prototype coding) for a 'projection free' geographic codebase with your basic point, line & polygon primitives. Rather than dealing with all the sacrifices that come ...
8
votes
3answers
9k views

Splitting lines automatically at specific distances using ArcGIS Desktop?

I have a set of polylines which I need to split at varying distances from their starting points. In general, I'm looking for a something similar to the SPLIT function within the editor tool. There ...
8
votes
3answers
974 views

Identification of consecutive points within a specified buffer

I have a point file, hourly relocations of an animal, and I want to be able to place a buffer around each point and calculate the number of subsequent points which are within the buffer zone. I am ...
8
votes
4answers
1k views

How to calculate the “depth” of a linestring using postgis

I have linestring features, which look like bent linestrings, hemicycles or convex or concave linestrings. In the moment I can select the distance between the startpoint and endpoint of each feature. ...
8
votes
2answers
4k views

Spatial distance analysis in QGIS

I'm quite new to QGIS and trying to figure out how to analyze the following problem. I have three layers: settlements point layer with 253 entries waste treatment facilities point layer with 24 ...
8
votes
2answers
1k views

Shortest path from points in one layer to points in another layer via roads in QGIS

I'm looking for a way to calculate the shortest path from addresses to subway stations via a network of roads. I have the Road Graph plugin, however, the addresses and subway stations are point ...
8
votes
1answer
2k views

PostGIS - Calculate progressive distance between points on a GPX path

I am attempting to build an elevation profile using PostGIS-PostgreSQL only. I have imported GPX data in my PostGis database, so now I have a table full of the GPS coordinates of the track and the ...
8
votes
1answer
3k views

How can I use roads from OSM data in R?

I need to use the roads to compare GPS positions to verify that they are no errors in the data. I downloaded the map.osm from a site that have information of City of Rome and had it transformed to ...
8
votes
3answers
3k views

Calculating avg distance between two non-parallet lines?

I'm currently working on creating a data model that will allow the analyst to digitize two non-parallel lines of approximately the same length. Currently the methodology is to divide the lines into 11 ...
8
votes
1answer
2k views

Automatically reducing polygon size in QGIS?

I am working with two polygon layers (counties & states) which I will 'intersect' to find which counties are within which states. Due to data inaccuracies I have to change all county polygons and ...
8
votes
2answers
361 views

Which SRS to use for global distance queries?

I have a database with a lot of points in WGS84. Now I am building an cache that performs NN and points in range queries using a KDtree. The point [sic] is that the search radius will be provided in ...
8
votes
1answer
2k views

Appropriate distance metric for spatial clustering of geographic coordinates

I have a set of locations in geographic coordinates, and I would like to group the points using hierarchical clustering followed by tree-cutting at various "heights" in order to calculate group-wise ...
8
votes
2answers
235 views

Given two lat/longs, how can I tell if they are within 1 mile of each other?

I'm trying to implement a very efficient check to see whether two points are within a mile of each other, or not. My current approach is to compute the Haversine distance, and then check to see if it'...
8
votes
1answer
5k views

Calculate distances between series of points in postgis

I have a postgres/postgis table containing a series of sequential points. I want to add a new column to the table which contains the distance between each point and the first one, and so forth until ...
7
votes
3answers
340 views

How to check if parcel is located by golf course

Is there any simple way for me to run millions of parcels through some type of script to see if a shape file parcel is on a golf course? For example if I have a layer that has all the golf courses and ...
7
votes
4answers
2k views

Create mid point from line layer

In QGIS I am trying to create a new point layer based on the mid point of a line layer (and keep all the feature attributes in the table). For example, one line feature becomes one point, located on ...
7
votes
1answer
5k views

Calculate distance from a Point within a Polygon to its edge

Let's say we have the following point and polygon: poly = Polygon([(0, 0), (2,8), (14, 10), (6,1)]) point = Point(4,4) Because point lies within poly, the distance from the first to the latter will ...
7
votes
3answers
16k views

Creating points based on distance and bearing from survey point using QGIS?

I am plotting witness tree data to calculate pre-settlement tree density. I have a shapefile with points along section lines (square miles) at each half mile. I am making another table that contains ...
7
votes
3answers
1k views

Network distance computations using GRASS

I'm an ArcGIS user who's interested in learning to use GRASS. Can anyone point out resources that will help me in learning how to obtain network distances between (1) residential locations (points) ...
7
votes
1answer
4k views

Calculating length of just portion of linestring that intersect with polygon using PostGIS?

I want to calculate the portion of the linestring that lies within the limits of a polygon. Better with an image What is the length of the portion of linestring within Province A? and within Province ...
7
votes
3answers
255 views

What's a term for Sea Level Distance which is usable by novice users?

I've been using the term Sea Level Distance to describe the total length of a line string where I ignore the elevation and just calculate the distance from point to point along the ellipsoid and sum ...
7
votes
1answer
2k views

Difference between planar and Euclidean distance?

I wanted a straight-line distance. When I was calculating near distance on Arc GIS, I was only given the option between planar and geodesic distance. But people in my field keep referring to my ...
7
votes
2answers
577 views

Creating a point on edge of closest polygon

My project is looking at a grid in the ocean. I want to capture each ocean point's distance to the nearest coastline as a weight, and then use buffer to capture the sum of nightlight data within a 1 ...
7
votes
2answers
411 views

Metric/parameters to compare length of polyline

What would be a good metric to compare the length of two polylines? A very naive approach would be to define a maximum delta which the two lines can differ. I'm looking for more approaches. For ...
7
votes
1answer
675 views

Understanding the values from transition layers produced by the R package `gdistance`

Background and Aim I would like to create a cumulative raster representing walking time across a surface. For my purposes, the cost to be accumulated has to be the walking time as influenced by ...
7
votes
1answer
787 views

How to group 10k points into closest pairs?

I was first faced with a problem of grouping 1000 pairs into unique pairs to minimise the total distance - since this was a small number I solved it using linear optimisation: Part 1 - Basic/Naive ...
7
votes
1answer
619 views

Finding density centroids within polygons in PostGIS

I want to find the highest density of OpenStreetMap nodes within a dataset of census geometries. I want to tie the census data to the location of the node which is most central in terms of population. ...
7
votes
0answers
978 views

Constructing a Voronoi diagram using a complicated travel time metric

I have in my possession four sets of shapefiles: 1. Locations (points), around 1000 2. Roads (lines), each road has a speed attribute 3. Terrain (polygons), each zone also has a speed attribute 4. ...
6
votes
5answers
29k views

For every point, distance to nearest polygon of type X?

In ArcGIS Desktop, can you calculate as an attribute value the distance to the nearest polygon of type X? Assume we have a point layer of wildlife observations and we want to know how far each of ...
6
votes
4answers
7k views

Calculate min distance between points in PostGIS

I have point layer in PostGIS database. Help please with query which add for each points in layer distance in attribute table between this point and another nearest point. Thanks! Update Calculate ...
6
votes
2answers
2k views

Way to find minimum value from a group of values - QGIS?

I'm wondering if there is a way to find the minimum value of a group within QGIS? Basically I need to find the minimum distance of each unique value in a table of about 5000 records. I can do the ...
6
votes
3answers
720 views

Creating duplicate line set distance away from a polyline in QGIS?

I'm new to QGIS and not really sure what I'm doing; I have a polyline of the UK coastline and I want to add another line 30 km offshore. Is this possible?
6
votes
3answers
4k views

Which is the most accurate method of measuring distance?

I aim to analyse the accuracy of the various methods of geodesic calculations (distance between two points on Earth)based on the three assumed models of Earth - flat, spherical & ellipsoidal. I ...
6
votes
2answers
199 views

Calculating daily travel distance from large dataset using QGIS?

My dataset is around 200 days worth of data on the daily distance travelled by a troop of monkeys. I've never properly used QGIS on my own so don't really know where to start. All of the days are ...
6
votes
2answers
1k views

Is there a way to calculate closest distances to a point without using Near Analysis?

I frequently get asked to calculate distances from a specific point (A drilling well in the middle of the sea for example) to a number of Environmental layers (Protected Areas, Pipelines, Other wells ...
6
votes
1answer
193 views

Deleting “lonely” points in QGIS?

I have a large point dataset of about 5.3 million points. I would like to delete the "lonely" points using QGIS, for example all points with no neighbor within a 5 km radius. The extent of my point ...