Hot answers tagged osm2pgrouting
6
A LINESTRING object consists of one and only one line with n vertices.
A MULTILINESTRING object consists of 1 to m LINESTRINGs.
In case of a routing network, it's not obvious to me why MULTILINESTRINGs would be used. If you plan to use pgRouting's shortest path function, the geometries are irrelevant anyway since it only needs source and target vertex ids ...
6
When faced with tasks like this your primary objective is to be rational. Don't change params based on 'gut feeling'. While the gut seems to works for Hollywood it does not for us who live in the real world. Well, at least not my gut ;-).
You should:
establish a usable and repeatable metric (like the time required by a pgrouting query)
save metric results ...
4
I have just the same problem and was about to ask on mailing lists, so thanks to everybody!
I am using Shooting Star with a million and a half rows on the routing table. It takes almost ten seconds to calculate it. With 20k rows it takes almost three seconds. I need Shooting Star because I need the turn restrictions.
Here are some ideas I'm trying to ...
4
Is it possible to load the global routing data into PostGis? What can I expect from a performance point of view? It's for routing purposes only.
Yes, it's possible to load global data in the database, but it is probably not possible to run long-distance routing requests if you expect a reasonable response time.
But you can make routing queries that clip ...
3
There is no error in your osm2pgsql output. It only gives a notice that it creates a vertices table with a serial column.
When the routing result looks fine, then the import and topology went well. You probably should check if you imported all ways you want to use and adjust the configuration file accordingly.
For multi-modal routing though (if you care ...
3
We have just created a branch in git for a turn restricted shortest path @
https://github.com/pgRouting/pgrouting/tree/trsp
Sorry no documentation yet, but but if you ask questions on the pgRouting list I hang out there and will respond. This code runs much faster than shooting star and is based on Dijkstra algorithm.
-Steve
3
If you are still open for other suggestions, I'd recommend osm2po instead of osm2pgrouting because in my experience it works without size limitations. It's also very easy to install. I've written a short how-to part 1 & part2 a while ago.
I've also written a guide on installing pgRouting on Windows which should help you install the binaries you ...
2
You'll have to create an INSERT statement that constructs a line from your centroid to your road segment.
Some useful postgis functions would be:
st_make_line
line_locate_point(ST_GeometryN(road.geom, 1), centroid.geom)
st_distance(road.geom, centroid.geom)
2
If these additions should only be visible to the user that added them, then you cannot add the data to OSM. You will have to store that data using your own infrastructure (database servers etc.).
Note however that if your user adds a driveway based on the location of a (say) street that you displayed to her using OSM data, then the data entered by the user ...
2
geometry_columns and spatial_ref_sys are created and populated by PostGIS automatically in case you add a geometry column.
The other tables are more or less temporary, used for finding links via assign_vertex_id. osm2po does all this segmenting-stuff for you.
All you need is the resulting table which is created by osm2po.
In addition osm2po does not rely on ...
1
http://www.webrian.ch/2011/07/set-up-pgrouting-with-openstreetmap.html describes one possible solution. The challenge is that osm2pgrouting does not import one-way information. The author uses GRASS to find one-ways from the data. This solution sets reverse_cost to -1 to mark one-ways.
In pgRoutingDocs there is "How to handle one-way streets"
The idea ...
1
I am just learning postgres and I just spent 3 hours with the same exact error. In my case I was loading a national roads network shp file for Canada. I fixed it by reimporting the data with simple geometry using the shpfile importer. (there is a checkbox under options, or -S at the commandline). There should be something similar for the OSM importer.
...
1
Which OS are you on.
local means none ip connection, socket connection. That said you may want to add the below since you are connection by ip.
host all all 127.0.0.1/32 trust
For ipv6 connection you would need:
host all all ::1/128 trust
(windows 7 for example usually tries to make an ipv6 connection when you put ...
1
Are you looking up this?
7.2. Restricted access¶
Another possibility is to restrict access to roads of a certain type by either setting a very high cost for road links with a certain attribute or by not selecting certain road links at all:
UPDATE classes SET cost=100000 WHERE name LIKE 'motorway%';
Through subqueries you can “mix” your costs as you like ...
1
Some of the road/way names in the OSM data seem to contain a backslash ("\") which they should not. This case is not tested and fixed by the "osm2pgrouting" tool so far and this most probably causes the error you get. What you could do is inserting the following line in the in the "exportWays" method in the "Export2DB.cpp" file (in the "src" folder of your ...
Only top voted, non community-wiki answers of a minimum length are eligible