Questions tagged [shortest-path]

The Shortest Path is the shortest or least-cost path from a source or set of sources to a destination or set of destinations. It can often be implemented in vector or raster GIS and is often desired in network analysis such as the shortest path to a location along the road network.

Filter by
Sorted by
Tagged with
1
vote
1answer
40 views

How to calculate the shortest path of adjacent points, from an origin to destination points? (ArcGIS Pro/ArcMap)

For a project I am trying calculate the shortest path (marked by points, not lines) connecting a point of origin to a destination point (different feature layer) and automate this for several segments/...
1
vote
1answer
31 views

Calculating shortest path using two network layers in PyQGIS

Using PyQGIS I can calculate the shortest path from point to point. But I need to calculate the shortest path based on two network layers: A and B. So that the result should be the shortest path from ...
1
vote
1answer
13 views

Editing network for shortest path

I am editing road network to create scenarios but Shortest Path is not recognizing the edits. I am assuming the edited street network is not connecting with other streets at intersections. I have ...
2
votes
3answers
69 views

How to connect points to lines in order using QGIS?

I have a set of points and I want to create lines from them. Points belonging to one line have unique UniqueID to be grouped by. I try to use QGIS' Points to path algorithm. What I don't have is an ...
3
votes
1answer
29 views

Compute the number of shortest paths that use a link

I am currently computing shortest path algorithms between two sets of points (origin set and destination set) and a road network, using the plugin QNEAT3. It works and gives me the distances between ...
2
votes
0answers
45 views

QGIS Shortest path (point to layer) start point expression in modeller

When in QGIS I run processing tool Shortest path (point to layer) ... I am satisfied with the result (below picture red line). But when I try to run the same tool in QGIS modeller, the result is ...
1
vote
1answer
36 views

Incorrect Shortest Paths

I compute shortest paths between ports. However, some of the resulting paths are simply incorrect. Consider the following example where coast is multi-polygon object of the planet's landmass (e.g. ...
2
votes
0answers
63 views

Using shortest path pgr_dijkstra

Versions PostGIS Bundle 3 for PostgreSQL x64 12 pgAdmin 4.24 pgrouting 3.1.0 I have also enabled the postgis and pgrouting extensions on a public schema. I am only just starting with pgrouting so I am ...
1
vote
0answers
17 views

How to connect / 'join' lines selectively but automatically in QGIS

I had a similar problem a while back with How to join (draw new) lines that are close but not touching - large dataset This is the same dataset, however I found a problem with what I did before. The ...
1
vote
1answer
47 views

Shortest path (point to point) when filling out coordinates in boxes

I am using the processing toolbox interface to launch the "Shortest path (point to point)" command to connect two points using a line network layer (see attached photo). If I fill out the ...
0
votes
0answers
43 views

Shortest road route calculation on OpenLayers GeoDjango

I have created a web based GIS application using Django, Mapnik, Mapproxy, OpenLayers 6. Now I need to develop a shortest path(road distance) between two points selected by the user. What is the best ...
0
votes
0answers
17 views

Finding x% of closest features to point using Network Analysis of QGIS

I have address points (Z locations), route lines, and polygon shapefiles. I need to find the route lines needed to reach 40% of all Z locations per polygon area. I have created centroids for each ...
1
vote
0answers
14 views

Calculation of intermediate points along shortest path not working correctly

I am trying to implement the calculation of points along the shortest path using the algorithm shown here: LatLng getGreatCirclePoint(double lat1, double lon1, double lat2, double lon2) { double d = ...
0
votes
0answers
66 views

Using pg_routing to connect point to closest point of set of points

Imagine we have the location of a person (point) and 100 restaurants (each is a point). My objective is to calculate the path from the person to the nearest restaurant (just one), but I want to avoid ...
0
votes
0answers
17 views

How to get all ID's for a line in a network of lines in order

I have a path (pink) in a network (green) and I want the id's of all the lines that make up that path. They are two separate layers. What I need returned is a list of id's in their order starting ...
2
votes
0answers
36 views

Shortest path from one to many points to return path id's using QGIS

I'm trying to find the shortest path between many points (pink) and one point (light green) using a network of lines (dark green). For each path found I need the list of line id's that make that path. ...
1
vote
0answers
44 views

Qgis Shortest Path Facility problem

My aim is to calculate the shortest distance between two point layers One point layer contains Origin points, the other point layer contains Destination points. Both layers contain more than 100 data ...
1
vote
0answers
26 views

Network Analysis Shortest path with original line segments as output

I've managed to batch run the shortest path algorithm and the shortest route (point to layer) in the output is perfect, except that I really need the individual attribute tables of the line segments ...
0
votes
0answers
117 views

What are the units in the network analysis

. I'm working on a project that is checking to see if distance is related to colonization by invasive species based on human activity. In order to do that, I must calculate the distances between ...
2
votes
0answers
37 views

Shortest path for a series of points

I have a points layer with bus stop locations and a line layer which represents the road network. I want to find the shortest path for each bus route based on the sequence of bus stops and save the ...
0
votes
0answers
18 views

Generate list of edges from ArcMap Python Network Analyst shortest path route

We are able to use ArcPy code to generate the shortest path route between two points in ArcMap using Network Analyst functions. Right now this just exports the shapefile of the route. What we'd like ...
0
votes
1answer
26 views

PGRouting Error Missing table?

I am trying to use pgrouting to find the shortest path in GeoServer. So I created new layer in sql view but its giving me error. I created 3 table in database: at_2po_4pgr = main table ...
0
votes
0answers
16 views

Shortest path not recognising network as connected

I'm trying to use a grid network that I have created to find the shortest path between two points accounting for directional wind-speed. The problem I'm running into is that the shortest path feature ...
1
vote
1answer
26 views

Problem with QGIS Network Analyst (Basic)

I'm going through the QGIS training, Lesson: Network Analysis, and I've encountered a problem with Network Analyst. When I open the Shortest Path (Pt to Pt) tool, I can set the Vector layer ...
0
votes
0answers
31 views

Networkx Dijkstra Shortest Path exists but is way too long - algorithm that gives me an approximation upfront

I am computing a shortest path with networkx. Works fine most of the time, but sometimes the nodes are connected, but over a really weird very remote connection in the network. In this case the ...
0
votes
1answer
153 views

Transition Function Inputs [closed]

I would like to define my own gdistance::transition function. However, there are two issues that I aren't clear to me yet. First, I do not yet understand what the input vector to this transition() ...
2
votes
0answers
61 views

Shortest path (point to point) in iteration

I am using Network Analysis-> Shortest path (point to point) to compute the distance between two points, following a network from OSM. It works like magic for single requests, but I do not seem to be ...
0
votes
0answers
47 views

Shortest path cost units

I am using the network analysis tool to compute the shortest path between points considering a layer with roads. The problem is that I am not sure about the units of the shortest path cost. For ...
2
votes
0answers
38 views

How to make output generated from shortest path in QGIS more reasonable

My goal is to generate bus route stop by stop given the bus route and stops with sequence number of single direction. I tried to achieve this by using shortest path in QGIS stop by stop. However, ...
3
votes
1answer
194 views

Shortest distance for multiple starting points

I am looking to calculate the shortest distance along a road network for multiple starting points. The reason I am not doing this manually is that I have more than 5000 starting points. Does anyone ...
0
votes
1answer
68 views

Iterate the shortest path point to layer

I have two layers. First layer defines the starting points and the second defines the end points. I just want to iterate the same algorithm "point to layer" by considering all the points of the first ...
0
votes
0answers
37 views

Why might Location Allocation give long paths when much shorter paths exist?

I'm using location-allocation in the network analyst toolbox of ArcMap to add features to my map. My objective function is to minimize impedance (meters). The image below shows the result. As you ...
1
vote
0answers
23 views

Shortest Path between large area — RAM issue

I built a shortest path algorithm that finds and stores the distance of the optimal path between neighboring grid cells using a friction surface as an input. It works beautifully but I am facing RAM ...
1
vote
1answer
69 views

How to get path cost in A* shortest path finder of GeoTools?

I am computing a shortest path with A* algorithm of GeoTools: AStarShortestPathFinder pf = new AStarShortestPathFinder( myGraph, nodeFrom, nodeTo, myAstarfun); pf....
0
votes
1answer
285 views

Finding the distance between two coordinates (longitudes/latitudes) which are not found as nodes in OSM

I intend to make my own OSM Router, and I do not want to use third party OSM routers. WHAT I HAVE DONE: I have downloaded OSM data in XML format and applied different algorithms to find the shortest ...
0
votes
0answers
30 views

Incorrect result when using v.net.distance on grass76

As shown in the image below I need to connect the points in yellow to the respective nearest point in brown via the shortest path on the road network in blue. I decided to use v.net.distance on ...
1
vote
1answer
273 views

Combining the output of ST_Collect/ST_Union to create linestring from multilinestring?

I am using pgr_dijkstra() to compute the shortest path and then using ST_Collect (or ST_Union) to get the shortest path geometry. However, the collection returned from the ST_Collect is a multi-...
2
votes
1answer
225 views

pgr_dijkstra gives wacky routes sometimes with undirected graph

I am using the function below to find the shortest path between several origin-destination pairs, and it seems to work correctly most of the time. CREATE OR REPLACE FUNCTION public.sp_od( orig ...
0
votes
0answers
32 views

The shortest path is not shown correctly at the time box

I am trying to find the shortest path using "Road Graph Plugin" in QGIS 2.18.22. When I set the Criterion as "Length", the length is shown but the time is not shown and it is shown as "infh". What ...
2
votes
0answers
216 views

Connecting points to lines via network layer in QGIS

So I have a set of three layers: A set of points A road network layer A line layer (e.g. which represents a cable) I need to find the shortest paths which connect the points (Layer 1) to the line ...
1
vote
1answer
324 views

Creating connected network of roads from overlapping roads using R?

I am trying to create a dataset of roads data to do shortest path analysis. To do this, my roads data needs to be connected: it should be possible to jump from one road to another. I am planning to ...
2
votes
1answer
167 views

Speed up the shortest distance calculation using pgRouting + PostGIS

I have to calculate the shortest path and corresponding distances for 300k+ origin-destination (OD) pairs. Using the query below it takes me around 0.3 sec to calculate one distance and therefore more ...
1
vote
0answers
64 views

Memory efficient shortest path algorithm for offline Android app [closed]

Finding the shortest path in a road network requires the road network to be loaded up in memory. Using Dijkstra's algorithm, for example, it searches through all the immediate road coordinates and ...
6
votes
1answer
156 views

Finding easiest path to walk on topographic map?

I want to make the shortest path between two points, but the thing is that there's a hill in the middle. I used Naismith's rule to calculate how the slope interfers in the walking time and I did the ...
3
votes
2answers
163 views

Cost-distance shortest path

I want to compute the shortest paths travelling overland between the origin (Africa) and destination (North America). My goal is to recreate human migration, and the shortest path should be across the ...
1
vote
0answers
177 views

Reporting distances to polygon features along river network using QGIS?

I am using QGIS 3.6 on windows 10. I am trying to work out a way of reporting on the distances to polygon features (ecological sites) located along a river network. I have extracted the shortest path ...
1
vote
1answer
135 views

networkx shortest path error

I am trying to implement single_source_dijkstra_path algorithm of the networkx to define the shortest path from a node to all nodes in the network. There are six sources in total, and I want to ...
3
votes
0answers
91 views

Finding path between points on limited road network

I am struggling to find a path between health facilities in Madagascar. I think that because the road network (from OpenStreetMap) is limited, the functions in QGIS, such as v.net.distance and ...
0
votes
0answers
285 views

OD-matrix (QNEAT3) doesnt return values for all input parameters in QGIS?

I'm running into problems trying to calculate shortest distance from point (smaller black dots below in image) to a port (tagged MANAUS below). Im using hte QNEAT3 OD-matrix tool (from layers as lines)...
1
vote
1answer
99 views

PyQGIS3 retrieving points from a shortestpath graph

I'm upgrading some code which worked with QGIS 2.18 to now work with QGIS 3.4.5 and had the following snippet working to retrieve a set of points from a graph created by the QgsGraphBuilder function: ...