Stack Exchange Network

Stack Exchange network consists of 174 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.

1
vote
0answers
51 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
33 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 ...
0
votes
0answers
10 views

Using pgrouting's pgr_dijkstra but ignore direction on residential roads [duplicate]

I have an OSM roads dataset in my PostgreSQL database, it contains a column "oneway" that indicates if a road segment is a one way or both ways (T if it is a one way and B if it is both ways). The ...
1
vote
2answers
64 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
54 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
48 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
0answers
22 views

Does pg_createTopology not create all topologies?

I created my paths from QGIS v2.18.18 and imported the shp file to pgadmin using GDAL with this command: ogr2ogr -f "PostgreSQL" "PG:host=localhost user=postgres dbname=routing password=password" "F:...
0
votes
0answers
33 views

pgr_dijkstra() giving out a weird path?

I'm wondering why my pgr_djikstra is giving me this path, My path is was created from QGIS v2.18.18, upon creating my lines I used Cleaning Tool and Explode Lines Tool to get my desired lines, then ...
0
votes
1answer
20 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
31 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
64 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
28 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
0answers
29 views

pgr_createTopology edge_table not found

Trying to create a topology like so: SELECT pgr_createTopology('roads', 0.50, the_geom:='wkb_geometry', id:= 'objectid'); Returns: NOTICE: PROCESSING: NOTICE: pgr_createTopology('roads',0.5,'...
0
votes
1answer
36 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
26 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
36 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
30 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
51 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
0answers
23 views

Avoiding segments using pgr_astar

I'm using pgr_astar function of PostgtreSQL to find the optimal path. I want to avoid some segments, so I used the method described here. I runned this query: SELECT a.seq, a.id1 AS node, a.id2 AS ...
0
votes
2answers
60 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
90 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
25 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 ...
0
votes
0answers
17 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
17 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
73 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
38 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
35 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
21 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?
0
votes
1answer
50 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
24 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
24 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
22 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
40 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
56 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
32 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
29 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
10 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
91 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
42 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
22 views

Retrieving the geometry of the lines by pgr_tsp()

How can I retrieve the lines with the pgr_tsp() pgRouting function to visualize it with QGIS
0
votes
0answers
24 views

Pgrouting - Assign existent vertices ids to start and target columns in network table

I am using pgrouting, in order to to prepare my data for Dijkstra, I need source and target columns in the "network" table, I found that Assign_vertex_id (that apparently doesn't exist anymore) and ...
0
votes
0answers
60 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
75 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
61 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
73 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 ...
0
votes
1answer
131 views

Route starting from closest node along edge

I am trying to find a way to route from the closest point on a linestring to my current location (lat, long). So far I am able to get the shortest path but it starts from the very beginning of the ...
0
votes
1answer
34 views

Polygons have holes after pgr_pointsAsPolygon

I calculate a 500m Isochrones with pgr_drivingDistance and after that use pgr_pointsAsPolygon to create the Isochrones out of the resulting nodes. SELECT * FROM pgr_pointsAsPolygon('SELECT id,x,y ...
0
votes
1answer
87 views

Using PostgreSQL functions in a QGIS Plugin

I'm planning to write a QGIS plugin which calculates isochrones. I have created an tested a network in PostgreSQL and now I want to create a plugin. The Idea is to use a point layer as input and ...
1
vote
0answers
58 views

Recommended instance type when using pgrouting in AWS [closed]

Some advice required please. When choosing instances in AWS (amazon web services) I can have a 'compute optimised' or 'memory optimised' instance. Can anyone recommend the best to use with pgrouting?...
0
votes
1answer
176 views

pgr_drivingDistance for isochrones

I´ve tried to calculate Isochrones in 500m walking distance along paths around planned subway stations with pg routing. For the setup I used an OSM-road.shp clipped to the borders of Vienna and a ...