Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [pgrouting]

pgRouting extends the PostGIS / PostgreSQL geospatial database to provide geospatial routing functionality.

4
votes
0answers
44 views

How to increase PostGIS/PostgreSQL memory to avoid Out Of Memory (OOM) error?

This is a follow-up question to my earlier question about the memory management of some PostGIS/PostgreSQL functions: How do PostGIS functions handle buffers and external storage? As suggested by ...
1
vote
0answers
10 views

Determine left/right based on headings of in & out legs

I'm analyzing roads layer to create navigation layer. Each vector Linestring segment has direction of traffic. Turn defined as where 2 directional segments meet. However, I find it challenging to ...
0
votes
2answers
22 views

osm2pgrouting can't connect to postGIS

I want to do some isochrones with pgrouting, and I am failing in setting up the network in the first place. osm2pgrouting doesn't find my postGIS installation. Also, the error message is not very ...
0
votes
1answer
37 views

Lot of roads are missing from pgRouting pgr_drivingDistance result

I started working with pgr_drivingDistance. Lot of edges (marked as yellow) are missing from result. Those seem to be cases, where routing algorithm has approached to same edge from two directions. ...
0
votes
0answers
26 views

pgr_drivingdistance seems to miss a few lines

For multiple stations I am running a pgr_drivingdistance function. Its nearly correct but it has a strange behaviour I can not place. The function seems to leave out some of the road segments around ...
2
votes
0answers
44 views

Route creation with specific length and elevation change [closed]

I'm currently working on a project for my computer science study. The goal is to make a service that allows the user to enter a distance and elevation change which will then result in a random route (...
1
vote
0answers
23 views

What is the difference between pgr_createtopology and pgr_createverticestable?

I'm using pgRouting and I'm going through the manual (Release 2.1.0) and in chapter five, it says: • pgr_createTopology - to create a topology based on the geometry. • pgr_createVerticesTable - to ...
2
votes
1answer
46 views

pgRouting assign source and target value to streets based on available nodes

I am a beginner in pgrouting. I have two tables in my postgres database. A street table, where each segment (see red line) carries an Id (ogc_fid). Additionally I have a nodes table (see brown points ...
1
vote
1answer
76 views

Multiple shortest paths with pgRouting using a list as a secondary table

I have been using a postgis database with pgRouting to solve shortest path problems. I have been using a query like: select seq, e.geom, pd.cost, pd.id1 as node from pgr_dijkstra( 'select gid as id, ...
0
votes
0answers
37 views

pgrouting control file not found error on Mac using EnterpriseDb bundle

I am new to PostGIS. I'm on a Mac running Mojave. I installed postGIS today using the EnterpriseDb bundle linked from https://postgis.net/install/ All works fine, apart from pgRouting. CREATE ...
0
votes
1answer
100 views

Walking distance with pgrouting for several locations

I'm intending to calculate the walking distance (not the linear distance, but the "real travelled distance") to several locations (e.g. social infrastructure). Thus I will have to create a routable ...
0
votes
1answer
35 views

Reverse driving distance

I am used to using pgr-route driving distance function to calculate how far I can go from a given point to a surrounding area Assuming that I have a transport graph that includes costs and reverse ...
2
votes
0answers
105 views

How to build a route that traverses every edge at least once and begins and ends at the same location?

I have a collection of lines in PostgreSQL w/PostGIS/pgRouting and have built topology. I need to produce a route that starts and ends at the same location, but traverses all of the edges. Can ...
1
vote
2answers
64 views

Ring geometries in pgRouting OSM DUMP

After performing pgRouting's "pgr_analyzeGraph" algorithm, over an Open Street Map dump uploaded to my PostGIS DB, I get this output, by I can't figure out what "ring geometries" are. Does somebod ...
1
vote
2answers
90 views

Looping through a table to allocate kids to nearest school

The general problem is to allocate town's kids to their nearest school and get the distance and the geometry. Tools in use is Postgresql 10.6, PostGIS 2.4.3 and PGRouting 2.5.2 There are three ...
0
votes
1answer
68 views

Using contextual information to plan route?

I downloaded the .osm map data, and I imported it to postgresql using the m2pgrouting. I have a CSV file on violence data, with three attributes, nature of occurrence, latitude and longitude. How do ...
2
votes
1answer
72 views

finding isolated rings in postgis

I want to find the isolated rings in an OSM dump loaded into PostGIS, using pgRouting. I need to do this in order to delete the isolated rings of the network. Does anyone know how to do it?
0
votes
1answer
25 views

Database based solution for TDSP (Fastest)

I have tried pgRouting in PostGres for finding shortest path select d.*, bs.starttime, bs.endtime, bs.trip_id from pgr_dijkstra( 'select id, source, target, traveltime as cost from my_table', ...
0
votes
2answers
52 views

Using original shapefile vs osm for routing in South Australia using pgRouting?

I'm looking at building a simple routing application using pgRouting. I'm running on Windows 10 at the moment but could migrate to Windows Server at some point. I'm trying to figure out how best to ...
2
votes
0answers
96 views

pgrouting extension slow in PostgreSQL 10?

I am trying to implement routing on my road dataset using pgrouting function pgr_createTopology. It works fine on postgresql 9.6 but gets extremely slow and get stuck as nodes increase in postgresql ...
1
vote
1answer
40 views

pgr_alphashape returns a self intersecting polygon

After using the function pgr_drivingdistance() I am attempting to make a polygon with pgr_alphashape. Following the example found in the documentation I should do the following: https://docs.pgrouting....
0
votes
1answer
37 views

pgrouting with an existing road net

I am tying to use pgrouting in order to calculate the distance that can be passed within a certain time period. Someone has provided me an updated OSM dataset with speeds. From there I am trying to ...
2
votes
0answers
28 views

Significance of Pgr_trsp() Function returning -1 in id1 column

I want to understand what's the significance of -1 value in column id1 of pgr_trsp() function output. When I run the below query I was excepting the source and target edge to be snapped according to ...
0
votes
1answer
54 views

Sequenced path using pgrouting (going through the POI of the user)

I'm using the pgr_astar function of Postgres and I want to personalize the optimal path proposed according to the preferences of the user. For example if the pg_astar propose the red path, I want to ...
1
vote
1answer
41 views

How to write dynamic SQL for a function that has dynamic SQL parameter?

I am trying to execute a string SQL query in function i.e. Create or Replace Function Route(edge_table text) Returns table(sequence integer) as $$ Begin Return Query Execute 'with r as( SELECT seq, ...
3
votes
2answers
59 views

Can Ksp Algorithm(Shortest Path Algorithm) have a constraint that the suggested paths must include a particular node or link

I am using pgr_ksp algorithm to find out the shortest path between a startnode and endnode by creating a network topology between all the nodes. Pgr_ksp algorithm very well gives me all the shortest ...
0
votes
2answers
76 views

Heuristic function of pgr_astar

Does the pgr_astar heuristic function of postgreSQL verify that the proposed path is optimal on time and length despite what mesure we choose as cost on the query? Example: When asking this query ...
1
vote
0answers
94 views

Optimal path proposed by pgr_astar is not the optimal one?

I'm using the function pgr_astar function of PostgreSQL to find the optimal path between two points in the dataset of Chicago. The query I'm using is: SELECT a.seq, a.id1 AS node, a.id2 AS edge, b....
1
vote
0answers
27 views

Refer to previous edges in PGRouting

I would like to write a cost functiont that takes into account the previous edge, rather than only the current one, to calculate for instance: Route with the smallest number of turns For that I ...
1
vote
1answer
33 views

Why PgRouting NodeNetwork function doesn't create cost and reverse_cost columns?

I'm following the instrcutions here step by step; Since my data is a custom road data that I couldn't find in Open Street Map I've followed these steps; Road data in SHP format transferred to ...
0
votes
0answers
19 views

How to change the map from template given by “suite-sdk create routing ol3view”

I'm following this tutorial http://workshops.boundlessgeo.com/tutorial-routing/ to make a dynamic routing web application. How can I add a map from my QGIS, the one shown in the picture, rather than ...
2
votes
1answer
82 views

Identifying OD-pairs where pgr_withPointsCost() did not find path?

I am currently working with the pgr_withPointsCost() function in order to get the shortest path costs for millions of origin-destination pairs of Points (OD-Pairs; Many-To-Many). I got the function to ...
0
votes
1answer
40 views

Using ogr for osm file to be used in pgrouting?

i was following this http://workshops.boundlessgeo.com/tutorial-routing/#preparing-data tutorial about building a routing application and thus im stuck in the step of preparing the data as to i dont ...
0
votes
1answer
43 views

Issue on Getting Geometry of pgRouting Query in PostGIS

I am running this query against a Table victoria enabled with pgRouting and PostGIS SELECT seq, id1 AS node, id2 AS edge, cost FROM pgr_dijkstra(' SELECT gid AS id, ...
0
votes
0answers
23 views

Blocked roads with pgRouting

What is the best practice to manage temporary blocked roads (works on the road) with pgRouting? Is there a dedicated feature adding exception? If not, i give an heavy weight to the edge?
1
vote
1answer
66 views

Running Query of pgRouting and PostGIS - dijkstra_sp_delta()?

Using PostgreSQL 10.4, compiled by Visual C++ build 1800, 64-bit PostGIS 2.4.4 pgRouting 2.6.0 and This Tutorial I am trying to run this Query $conn = pg_connect($conString); $sql = "...
1
vote
1answer
27 views

How to remove the mirror route on postgres for shortestpath using pgr_ksp algorithm?

I have created an underground route for few points and when I try to see the possible routes using pgr_ksp I end up with an extra route which is not present in the geom table. In the image below, ...
0
votes
0answers
26 views

Missing roads of San Francisco and extra parts on the map

I'm using OSM dataset of San Francisco that I have imported using osm2po to PostgreSQL and I think that there are some data missing, because when I use pgr-astar to find the shortest path, there is ...
0
votes
0answers
27 views

Argument in pgr_createTopology() function as query

I am using pgrouting 2.1.0. I have spatial and non-spatial data in different table(in different schema). Here I am creating a view which contain geom(filled), id(filled) source(blank) and target(...
0
votes
1answer
44 views

Ambiguous values on OSM to calculate optimal path: Which value should I use?

I'm using San Francisco OSM dataset, I want to calculate the optimal path using pgrouting(pgr_astar) The problem that I don't know which column should I use? For example: I want to calculate the ...
0
votes
1answer
58 views

OSM database and congested roads

I'm using San Francisco OSM database, which contains the name of each edge, the id source and id target of each vertex. I need to use the information of the most congested routes in San Francisco, but ...
3
votes
1answer
38 views

Pgrouting “source not found error”

Objective : To know shortest path between two points. Background : Created sample data ,converted into table in PostgreSQL ,in addition created topology,routing using pg routing extension. Data is ...
0
votes
0answers
36 views

Routing from user location to POI in pgRouting?

I have roads(edge) table and hospitals(point of interest) table in pgRouting database. Now I want to take user location or any point location that user inputs as a starting node and ending node must ...
0
votes
0answers
11 views

search for road data using coordinates.? [duplicate]

I have the path data labeled tabel_roads, I want to find the nearest road using coordinates. this is the script I have, but it does not work. select id from tabel_roads ...
1
vote
0answers
113 views

PgRouting queries too slow

I'm writing a function that returns routes using PgRouting (v.2.6) The main problem I'm having is that I cant get the time less than 1 second per query. The main query I need is get time, length, and ...
1
vote
1answer
49 views

Get barrier edge id

I have a table of POINTs that represent barriers. I would like to be able to find the closest edge id on the edge graph so that I can have the routing algorithm ignore that edge (thus route around it)....
0
votes
0answers
78 views

How to get points which are reachable in given amount of time(pgrouting)

I am trying to get points which are reachable in given amount of drive time from a point. I have a table of hospitals points. And I have OSM map data of an area which is converted to work with ...
0
votes
0answers
117 views

pgr_createTopology() 'Connection to the server has been lost'

When trying to create topology from pgAdmin 4 (version 2.1) with the pgr_createTopology function I get an error: "Connection to the server has been lost." The database is on localhost. The input ...
1
vote
1answer
106 views

Can I import Network Dataset in PostgreSQL through pgRouting or Polyline Shapefile?

I need to make an application for the Quickest Route to the nearby hospitals from the incident place. I have read many articles and papers but I am confused whether I need polyline shapefile or ...
0
votes
1answer
103 views

Join edge table on pgRouting trsp()

I am trying to figure out why pgr_trsp() isn't giving me the interpolated route (start and end positions are the full line instead of somewhere along that line). I believe it has to do with the way I ...