22
votes
Determining pgrouting version
Another option would be select * from pgr_version()
12
votes
Accepted
How do PostGIS functions handle buffers and external storage?
No, most of these "higher order analysis" functions do not have any special handling for data sets that are larger than can fit in memory. If you run them on such data sets, you'll just OOM the ...
10
votes
Accepted
PgRouting : Shortest path starting from the closest vertex not the closest node
While still not in the official release, the withPoints family of functions is in a stable state since pgRouting 2.2 (?) and provides a dynamic interface for temporary nodes in a graph, i.e. routing ...
9
votes
Accepted
How are cost and reverse cost computed in pgrouting?
For osm2pgrouting V2.1:
length is length of the segment in degree units
cost and reverse_cost is the length in degree units. (include the negative values for wrong way)
length_m is in meters (there ...
9
votes
Wrong shortest path using pg routing
The two lookup points you pass into the (K)NN sub-queries can't be referenced in EPSG:3857 - their coordinate values seem to be in degree and are likely EPSG:4326!
Assuming planet_osm_roads.way has ...
8
votes
Accepted
pgr_createTopology with large datasets
The following is what I am using. Some of it is specific to our deployment environment since we are using docker and some bash scripts to deploy and set up the server. You could easily get rid of all ...
7
votes
Why is any pgr_* routing function taking forever based on OSM data in an pgrouting enabled DB
Use this guide to set up indexes for a spatial database. Here is the gist of it:
1. create indexes on ID, source and target columns.
2. create index using GIST on geom column.
3. vacuum
4. ...
6
votes
Accepted
Speeding Up pgr_dijkstra using bounding box in PostGis2.0
Schemy just build the build the bounding box check in your query or wrap the pgr_dikstra in a function that does
e.g.
SELECT SUM(
(SELECT ST_length(ST_Transform(the_geom,28355))
FROM ways ...
6
votes
Dashed lines in pgRouting
The reason for these kind of errors is ususally a wrong network topology. In particular you must make sure, that you use the correct unit (meter or degree) for the tolerance value in the ...
6
votes
Accepted
pgr_dijkstra is considering one-way streets as bidirectional
You are passing in the metric length ST_Length(geom::GEOGRAPHY) of each edge E as both cost & reverse_cost - rendering it equal to to the undirected counterpart.
pgRouting realizes ordered graph ...
6
votes
Accepted
Is the geometry type of PostGIS represented as WKT or just the Point type?
PostGIS internally stores geometry data as binary objects which are optimized for scanning and processing. Geometry objects include the SRID.
WKT, EWKT, WKB and EWKB are just representations for ...
6
votes
pg_routing error when generating alpha shapes
Note that pgr_pointsAsPolygon has been moved to legacy as of pgRouting 3.0.0 - I won't address this function.
Read the docs carefully; the full function signature
pgr_alphaShape(geometry, [...
5
votes
Creating drive time polygons using Open Source tools?
You might want to check out the open Route360° JavaScript API, which works with both Leaflet and Google maps. It returns travel time polygons for the following travel modes: walk, bike, car, transit.
...
Community wiki
5
votes
How to install pgRouting in Ubuntu 14.04?
sudo apt-add-repository -y ppa:ubuntugis/ppa
sudo apt-add-repository -y ppa:georepublic/pgrouting
sudo apt-get update
sudo apt-get install postgresql-9.3-pgrouting
Now you should be able to add the ...
5
votes
pgr_dijkstra function with geometry column in result
Join to table ways is as for now only solution (BTW recommended in all official documentation and workshops)
5
votes
Accepted
5
votes
win10/CREATE EXTENSION Pgrouting--could not access file "$libdir/libpgrouting-2.3"
This sounds like you are using the BigSQL distribution. Do not use the installers for that since the PostgreSQL folder layout of BigSQL is different from PostgreSQL EDB distribution (which is what ...
5
votes
Setting up pgRouting
You are trying to follow instructions from 2011. They don't apply to current versions of PostGIS/PgRouting.
Instead, just do
CREATE EXTENSION Postgis;
CREATE EXTENSION pgrouting;
PgRouting should ...
5
votes
Accepted
pgrouting with oneway
You would need to prepare your data beforehand. Add cost and reverse_cost columns to your ways_noded table. Then, you populate them using the way length if usable in this direction, or an insanely ...
5
votes
Accepted
pgrouting no result // topology problem
EDIT 3:
After a long discussion in the comments I reviewed my answer, taking the sample data and it´s upload into PostgreSQL from within QGIS into account. I deleted my EDIT 2 as it became useless.
...
5
votes
Multiple shortest paths with pgRouting using a list as a secondary table
You want to simply run that function on every row in the <list> table; generally speaking, this is no different than any other function applied to a column/row. In practice, this here is a ...
5
votes
Shortest paths between points over multiple linestrings
As you already pointed out, this indeed can be solved with pgRouting and will have to be added to your database as an extension. You will have to do some preparations with the data to get it going.
...
5
votes
Calculating cost values in pgRouting using ST_DWithin
You should simply
UPDATE
utrecht_osm_foot_2po_4pgr_duplicate
SET
cost_greenery = cost / 1000
WHERE
ST_DWithin(geom_way, osm_meta, 30)
;
If no update happened
make sure your geometries have a ...
4
votes
Accepted
"linestringZ" kills "pgr_createTopology"
Unfortunately that parameter needs to be a column name, so you can't apply a function to it since it builds an sql internally. If you don't need your column to have a Z, then I would suggest changing ...
4
votes
How to fix pgr_dijkstra error, query must return columns 'id', 'source', 'target' and 'cost'?
The possible cause is what the error says: the first argument of the pgr_dijkstra(sql:text,..) function must contain an SQL statement, which returns id, source, target and cost.
In your case you ...
4
votes
PgRouting Obtain RoadNetwork data from osm file
The "Topology" chapter of the workshop is there to explain the basics about the routing network. The first paragraph should actually explain that. If it's not so clear, then I will change this with ...
4
votes
What is an undirected graph with cost and reverse cost?
Maybe the documentation at http://docs.pgrouting.org/dev/src/dijkstra/doc/index.html#pgr-dijkstra can shed some light onto the isse. It would seem like - in an undirected graph - one can go in either ...
4
votes
Assign_vertex_id function does not exist
I am running pgrouting version 2.0.0, and assign_vertex_id or pgr_assign_vertex_id doesn't exist.
To build the topology, I use the function pgr_createtopology.
In your case, you could go like this:
...
4
votes
Accepted
How to use pgr_dijkstra many-to-many
You don't need the SELECT of the array, just return the array of the SELECT (in other words, remove the "select"):
SELECT * FROM pgr_dijkstraCost(
'select id, source, target, cost, reverse_cost ...
4
votes
Add one-way streets to network data in postgis
In pgRouting the direction is always from source to target.
When you run pgr_createTopology(), then source is the start point of your line geometry and target is the end point.
If you want to model ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
pgrouting × 884postgis × 445
postgresql × 251
routing × 108
openstreetmap × 105
osm2pgrouting × 83
qgis × 82
osm2po × 64
postgis-2.0 × 36
dijkstra × 36
sql × 30
network × 28
shortest-path × 27
osm2pgsql × 21
geoserver × 17
topology × 15
route × 15
openlayers-2 × 14
installation × 14
openlayers × 11
distance × 10
isochrone × 10
travelling-salesman × 10
ubuntu × 9
astar × 8