A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [pgrouting]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
30 views

Query example in pgrouting by PostGIS

I found a query in the web which create catchments by pgrouting. I tried the query several times and modified a bit. But it dosen´t work. It alwys shows me the same error. DO $$ DECLARE c ...
0
votes
0answers
11 views

pgr_dijkstra not returning anything when using the same vertex

I'm using pgRouting 2.3 and in the description of the pgr_dijkstra function states that: When the starting vertex and ending vertex are the same, there is no path. The agg_cost the non included ...
1
vote
2answers
63 views

function pgr_pointsaspolygon(unknown) does not exist

Im trying to run the query below in postgresql/postgis: SELECT ST_AsText(pgr_pointsAsPolygon('SELECT id::int4, ST_X(geo)::float8 AS x, ST_Y(geo)::float8 as y FROM junction WHERE id IN ( 1050062040,.. ...
1
vote
1answer
46 views

Query shortest path from coordinates with pgrouting

How do I calculate the path, pass coordinates and, if possible, in the return function, have the route coordinate list? (I'm trying to plot the route with the ipyleaflet library in a jupyter notebook, ...
1
vote
0answers
22 views

pg_ksp is extremely memory intensive for k>1

I am using pg_ksp (from the pg_routing extension for postgis) on a subset of the OpenStreetMap database with 400.000 nodes, if I set k=1 to find the best path the query takes about a second and around ...
1
vote
0answers
32 views

pg_routing source and target column issue

I have created pgr_createTopology() function on my road data table which accurately assign source and target to destination road table, but I have an issue when I split a road segment in qgis it ...
2
votes
1answer
27 views

Creating polygon from points with other attributes in pgRouting

I have table, which looks like this: This is the result of pgr_drivingdistance. I would like to create a polygons for each mz. I tried to use group by. drop table if exists service_area_polygon; ...
1
vote
1answer
57 views

Calculate catchment area with pgrouting

I have the road networks from osm and I created topology. I know that dijkstra algorithm works, because I calculated the shortest path from two point layers. Now I would like to calculate catchment ...
0
votes
0answers
24 views

pgrouting at unsplitted roads

I have a railroad network and want to use shortest path algorithm on that. Unfortunately I have a problem at this intersection, where I want to have the path coming over edge 14692 to 14620 and ...
2
votes
0answers
50 views

How to make Dijkstra faster?

I would like to compute shortest path between 2,5 millions pairs. I created table with id, origin, the nearest node of origin, destination, the nearest node of destination. I also created index on ...
2
votes
1answer
67 views

pgr_createTopology uses too much memory and “connection to the server has been lost”

I have the large roads network (urban walking paths). I'm trying create topology in my database but when query reaches 175 thousands of edges, begins to increase memory usage. In the same time CPU ...
1
vote
0answers
35 views

pgr_dijkstra invalid memory request size

I am trying to create a network of paths using pgr_dijkstra. I keep getting an invalid memory error: ERROR: invalid memory alloc request size 1080000000 CONTEXT: SQL function "pgr_dijkstra" ...
1
vote
1answer
98 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
85 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
29 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
1answer
63 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
119 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
26 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
24 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
150 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
113 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
47 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
50 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
93 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
253 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
32 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
140 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
58 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
202 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
24 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
24 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
103 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
15 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
33 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
74 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
53 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
62 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
33 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
99 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 ...
3
votes
1answer
208 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
1answer
189 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
38 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
172 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
92 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
106 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
74 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
101 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
32 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
78 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
128 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 ...