Questions tagged [pgrouting]

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

pgRouting is an Open Source software add-on to PostgreSQL / PostGIS to find routes through road networks and solves general graph analysis problems.

Project homepage: http://pgrouting.org/index.html

144 questions
0
votes
1 answer

How to use PostgreSQL pgrouting functions to find the shortest path between two geometry points with MOST K edges?

I have set up tables containing vertices and edges (representing airports and the route between them). Using the following query I'm able to get the shortest path between two points. SELECT p.seq, p.node, p.cost, r.geom as edge_geom,…
Majid Akbari
  • 190
  • 2
  • 10
0
votes
1 answer

PGRouting functions prefixed with "_" not found

New to Postgres / postgis / pgrouting galaxy here. I have to create a docker instance of a Posgres server. Several postgres extensions are installed on it, providing functions available in the public schema, some of them prefixed with an…
0
votes
1 answer

Analysis electric network with pgRouting

Electric network is a kind of utility network in GIS. In this network we have a point layer that consist power stations and end users. Power stations called source and end users called sink. And also we have one or more line layer that consist power…
Ali dashti
  • 360
  • 2
  • 17
0
votes
1 answer

Find closest match from 2 columns in postgresql

I have a table "ways" containing coordinates (lat/lon) values. Suppose I have a coordinate (x,y) and I want to check the closest match from the table ways. I have seen some similar questions like this: Is there a postgres CLOSEST operator? However…
lyng
  • 3
  • 1
0
votes
0 answers

Adding Barriers shapefile in postgres/postgis/pgrouting

Good day, Guys, I am new to the platform. Please can anyone give me a detailed procedure on how to configure my pgrouting extension so that it can recognize barriers and avoid them in my network after importing the barrier shapefile into Postgres
0
votes
1 answer

pgr_dijkstra returns an empty set

I'm trying to write a function that is able to find the shortest way between two points using pgr_dijkstra function. I'm following this guide. With data provided in the guide everything works fine. But when I try to apply the same steps (build a…
goedwig
  • 351
  • 1
  • 2
  • 11
0
votes
1 answer

Create a function that makes the query with all the elements of an array one by one with postgres

I am preparing a function for PgRouting that is based on another function that I have also prepared. The purpose of this is to make a function that by entering the origin and destination coordinates of a route as a response. I got it from point to…
Pacman
  • 1
0
votes
0 answers

Directory Failed to Open on osm2pgrouting

I'm trying to import osm data using osm2pgrouting, the process is stop during parsing data which given this error notification: Error Opening "D:/mydir/data.osm":No such file or directory failed to open/ parse data file "D:/mydir/data.osm I have…
0
votes
1 answer

postgres SQL query throws error in node JS

I set up an API where on client side user can calculate a route between to points. However, I have trouble with the psql query, which works in postgres but when I use the same query in node JS I got an error. I am using nodeJS, Express and Postgres.…
Candy
  • 95
  • 1
  • 10
0
votes
1 answer

pgr_createtopology, can't find the right tolerance needed for my routes which is created in QGIS and imported by GDAL

I created my routes in QGIS v2.18 and tested it if it is routable or not by using the Road Graph Plugin in QGIS and as shows in the image below it is routable with my plugin's tolerance set as 0.0000 and WG:84 4326. But when I import the shp file…
0
votes
1 answer

how to use a loop with the function pgr_dijkstra

I want to use a loop to calculate the distance traveled between two nodes 152 and 17720 (I use the function pgr_dijkstra) by deleting each time a cell. A cell contains several road links. the grid_edges_routard table contains the road links and…
rihab
  • 3
  • 2
0
votes
3 answers

Postgresql remove duplicate reversed pairs

I have this table: origin destination new york seattle new york chicago new york portland seattle new york seattle chicago chicago new york I have to build a graph so I need to remove all the duplicated…
franco_b
  • 868
  • 3
  • 13
  • 31
0
votes
2 answers

How to select just result value without row id and column name for function in sql?

I do pgRouting and I need to insert integer result to dijkstra algorithm from my SELECT. SELECT ST_AsGeoJSON(ST_Transform(way, 4326)) AS geometry FROM pgr_dijkstra( 'SELECT osm_id AS id, source, target, st_length(way) as cost FROM…
Marek Bernád
  • 481
  • 2
  • 8
  • 28
0
votes
0 answers

pgr_nodeNetwork taking a very long time to run

I am using pgr_nodeNetwork from the extension pgrouting of PostGIS/PostgreSQL. I'm currently running this algorithm on an edges table (it's a network of roads) that contains approx. 100,000 edges. It has been 17 hours and the query still hasn't…
R. Bourgeon
  • 923
  • 1
  • 9
  • 25
0
votes
1 answer

Does PostgreSQL version 10 support pgRouting version 2.6?

I installed pgRouting version 2.6 through brew and I have PostgreSQL version 10.4. Now I have question: does this PostgreSQL version support pgRouting extension or not? Because every time I query: SELECT * FROM shortest_path('SELECT gid AS id,…
M.Silen
  • 3
  • 2