Questions tagged [pgrouting]

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

Filter by
Sorted by
Tagged with
1
vote
0answers
38 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-...
0
votes
0answers
24 views

Line Grid from points in GIS (ArcGIS and QGIS) [closed]

I have a map with points which contains attributes such as lat, long and other information. What I want to do is join points depending upon the lat, long with reference to its nearest point in the map ...
2
votes
1answer
67 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
21 views

What closeness measures are appropriate to this undirected graph?

I need a way to measure the closeness centrality of every single NODE(i) in respect to all NODES(j), 1 NODE(i) to all NODES(j) and, another measure that describe somehow the geometric properties of ...
1
vote
0answers
30 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
1answer
49 views

Why pgr_dijkstra() only finds the routes that are pretty straight?

I am trying to use pgRouting in order to find the shortest route between two points. I realized that pgr_dijkstra() function is not able to find the route when the two points are far from each other ...
1
vote
1answer
25 views

Fails ST_intersects(geom, select statement) for drive time

I am trying to select houses in a drive time isochrone. I have the code working fine to make the isochrone. I can't place the results in a seperate table I need the isochrone in a where clause Is ...
1
vote
0answers
19 views

pgRouting bus travel mode [closed]

I am preparing a routing function with pgrouting with the travel model in public transport (bus). I already have all the stops related to the table of ways (downloaded by osm2pgrouting) I have my ...
3
votes
0answers
107 views

Computing driving directions in pgRouting/PostGIS?

I have calculated shortest route/path by using pg_Dijkstra algorithm in PostGIS and it is working fine. Now how to calculate driving directions from starting edge to end edge. I have gone through the ...
4
votes
1answer
100 views

PGrouting number of results in pgr_dijkstraCostMatrix() not right

When running the pgr_dijkstraCostMatrix() on a PostGIS database with 41000 id's I get only 144000 rows in the matrix. I would have expected much more. What am I missing? I parsed the OSM data with ...
1
vote
1answer
32 views

Creating Isochrones - pgr_drivingDistance 2.6 SQL error

Im trying to create a matrix of driving distances from an osm2pgrouting parsed dataset. Following many blogs I have the below incorrect SQL: SELECT * from ways join ( SELECT * FROM ...
1
vote
1answer
41 views

Pgrouting: Visualizing analyzegraph ring geometries

I have a sample network that I analyzed using pgr_analzyeGraph. The outputs shows that I have 3 ring geometries. How do i get which nodes is part of the ring geometries? The official document only ...
2
votes
1answer
72 views

Routing on rail network with interim points (pgrouting)

I want to use pgrouting on a rail network, stored in PostGIS. For each service number I have all the station it stops at. Until now, I set up start and end nodes for the rail edges and created the ...
4
votes
1answer
234 views

ST_LineMerge to simplify road network

I am trying to simplify my road network by finding all segments that touch 2 other lines with a common attribute, join_id and street, then doing a st_linemerge. I do NOT want to merge lines where ...
0
votes
0answers
26 views

Configure mapconfig.xml for null tag_value

I am using osm2pgrouting version 2.3.6. When using osm2pgrouting for .osm file, I created tables ways. However, when I compared it with table planet_osm_line, it lost a lot of line. I determined ...
1
vote
1answer
87 views

Performing isochrone in PostGIS by pgRouting?

In pgr_drivingDistance for isochrones the person who answered, missed to say the explanation of the answer about what function used by him to get the output for isochrone. I want to do the same but I ...
2
votes
0answers
48 views

Getting travel time while performing pgrouting i.e. what are parameters and function required?

While doing the pgrouting to find the shortest distance I got success in getting the output but when I thought to come up with the time consumed for travelling, I cannot find the proper source to get ...
3
votes
1answer
135 views

Creating map of travelling salesperson problem solution with pgrouting?

I have created the "ways" (=edges) and "ways_vertices_pgr" (=nodes) tables from OSM road data with osm2pgrouting in PostGIS. I work with this data in QGIS. Given a set of ids from the "...
1
vote
0answers
23 views

Which sensitivity analysis is most suitable on cost factors in route planner? [closed]

I am working on developing a route planner with alternative impedance/cost factor (safety of the route). I am building the application mainly in pgRouting. As a final step I would like to perform ...
0
votes
0answers
23 views

pgRouting TSP with eventual order constraints?

Is-it possible to run Travelling Sales Person (TSP) in pgRouting (I've got 2.3... installed) with constraints? A general TSP algorythm or those I've identified in pgRounting solve the TSP problem ...
4
votes
0answers
86 views

Increasing 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
12 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
28 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
54 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
42 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
56 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
30 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
67 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 ...
2
votes
1answer
128 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
58 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
150 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
37 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
138 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
78 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
101 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
73 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
84 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
29 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
68 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
122 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
57 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
41 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
74 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
46 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
67 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
90 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
101 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
61 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 ...