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
0
votes
0answers
5 views

Syntax for saving the output of OSMnx shortest_path as a shapefile

I am trying to figure out how to trace a route between two points along a road network extracted from OpenStreetMap using OSMnx. The origin and destination points are to be read from a shapefile (or ...
0
votes
1answer
19 views

Seeing which node has given node ID in osmnx [closed]

I have been reading the documentation on OSMnx and I am trying to use the command osmnx.shortest_path(G, orig, dest, weight = "length") on a graph of a city. I know which nodes I want to ...
0
votes
0answers
12 views

Output from Mean coordinate to input of shortest path in model

I'm building a model in QGIS 3 and I want to be able to "feed" the output of Mean Coordinate to the input "Start point" of Shortest Path. The issue is that in Shortest Path I ...
1
vote
2answers
43 views

Alternatives to Network Analyst in ArcGIS for utility network tracing

I have feature classes of lines (roads) and two types of point feature classes (let’s call them “sources” and “sinks”; there are many sinks for every source). For every source, I need to trace the ...
1
vote
1answer
22 views

Keep line attributes in QGIS Network Analysis - Shortest Path

I'm running a simply Shortest Path task from the Network Analysis toolbox in QGIS, but it seems that the output doesn't transfer the line attributes, only the start layer attributes. I need the road ...
0
votes
2answers
36 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 ...
0
votes
0answers
23 views

Finding the point closest to a point in another feature class and the paths between them

There are two point feature classes (let's call them Sinks and Sources). Working with ArcGIS Desktop, I need to find, for each Sink, its nearest Source. Normally I'd do a spatial join, but this time I ...
3
votes
0answers
35 views

Shortest line network route between clusters of points and the cluster centroid

I have a point layer containing clusters of points (premises) that I have grouped using a clustering algorithm (the clusters each having their own unique ID which I have used to create convex hull ...
1
vote
1answer
85 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
45 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
18 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
229 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
33 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
65 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
45 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
116 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
24 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
75 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
60 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
18 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
16 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
77 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
19 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
46 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
49 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
28 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
182 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
44 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
1answer
30 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
33 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
1answer
229 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
78 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 ...
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
250 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
74 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
46 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
24 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
85 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
367 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
354 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
327 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
33 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
283 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
387 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
223 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
83 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
175 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
185 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 ...