Hot answers tagged

7

You can find such a function here: https://github.com/pgRouting/pgrouting-contrib/blob/master/wrapper/routing_core_smart.sql#L69 It searches for the nearest link in the network, which usually gives a better result. If you use Shooting Star you can then start routing from/to this link. For A* or Dijkstra you either select start or end point of the link, or ...


6

The only practical way is to add the 'missing' routes the data yourself. OSM probably shouldn't be putting parking lots into its walking routes. There are liability issues with adding routes that aren't real, properly maintained pedestrian paths. A parking lot, though walkable, could be dangerous and could be private property. You'll have similar issues with ...


6

Yes, it's possible. But osm2po only takes barrier=bollard into account by default. If you need other types of barriers you'll have to use Java in order to override DefaultNodeTagResolver.isBarrier(). For pgRouting this information can be retrieved from the Vertex-Table which is not written by default, but can be activated by setting ...


5

This should do the trick: Open the osm2po.config in a text editor. Uncomment (remove the '#' sign) for wtr.tag.highway.service = 1, 51, 5 and wtr.tag.highway.track = 1, 71, 10 Scroll down and check out the Allow/Deny-tags For example, "wtr.allow.highway.track = foot|bike", this means only foot and bike are allowed on this highway. This ...


5

Firstly, decide which roads are candidates for walking: Add "foot" to the list of allowed types wtr.tag.highway.residential=1,32,50,car|bike|foot wtr.tag.highway.pedestrian=1,62,5,bike|foot Set the finalMask in order to take them into account wtr.finalMask=car|bike|foot If you are only interested in walkable roads, set wtr.finalMask=foot Set ...


4

Just an assumption: osm2po builds blocks of 25 data rows per insert for performance reasons and to avoid memory issues. Do you import it in one single Transaction (parameter -1 or --single-transaction)?


4

public static double calcDistanceSphere( double lat1, double lon1, double lat2, double lon2) { // see: http://www.movable-type.co.uk/scripts/latlong.html double d = StrictMath.acos(StrictMath.sin(lat1 * RAD_PI) * StrictMath.sin(lat2 * RAD_PI) + StrictMath.cos(lat1 * RAD_PI)* StrictMath.cos(lat2 * RAD_PI) * ...


4

The attribute you are looking for is the clazz column. Tipp: Compare the values to those configured in the osm2po.config file.


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 ...


4

Bearing in mind Sean's answer (that you have to add 'missing' pats yourself) as well as that these missing parts technically are parts of road-graph which are in turn are just lines, here is the quick'n'dirty workaround you may use. If the walking path has a common point with a "walkable" polygon, export this polygon's border as a line into your road-graph ...


4

It's the nature of osm that everyone can modify things. Hence you cannot rely on IDs.


4

What you need is a directed graph. The table osm2po creates for pgRouting is not directed. Nevertheless you can derive one forward and one backward edge from each segment (table-row). The result is an adjacency list - a little different from your representation: graph = { 'A': {'B': 10, 'D': 4, 'F': 10}, } osm2po (and I think pgRouting does also) uses ...


4

Ok, I am sorry about me answering my own question. I guess I had to ask the question to think about it more and be able resolve the problem. It turns out the problem was not in the OSM data but with the osm2po default config file I use to generate the graph. The problem Somewhere (line 188, if you are using osm2po 5.1.8) in the default config file, there ...


3

Yes, this is possible by modifying the cmd= parameter. By default the value is tjsgpr (Tiler|Joiner|Segmenter|Postprocessors|Graph-builder|Routing). cmd=c is short form of cmd=tjsp. In the German documentation there is a table around page 15 explaining each command. Only for t (Tiler) for example you need to pass the data source URL or path, j depends on t, ...


3

I've just modified osm2po-tsp. Now it should handle different sources and targets and intermediate vertices.


3

Are you using SOAP or HTTP/GET via JavaScript/AJAX? In both cases you get all segments where each segment contains the distance and time values. All you have to do is to add those values.


3

Have a look into the osm2po.config file. There you'll find lines like this one: wtr.tag.highway.motorway = 1, 11, 120 (concurrent order, clazz, default speed) e.g. filter your clazz-column (clazz=11) and you'll retrieve all motorways. concurrent order means, that if osm gives you two main tags for the same street (e.g. highway=residential and ...


3

The new osm_meta-column has been introduced to satisfy future request. In some of my test cases I populated it with Routes (Relations) e.g. of Bus-Lines or MTB-Tours.


3

Indeed, you can improve the performance a lot. What you are doing here in order to fetch a distance between two points is to call the entire routing batch for each pair. Usually a routing needs three steps: Finding the nearest Source- and TargetVertex on the network. Calculating the shortest path between them Reconstructing all path informations ...


3

Problem with pgRouting performance seems to be that new pgr_astar and pgr_dijkstra use whole graph (which guarantees solution if there is one). Simple solution to get better performance is limit used graph to smaller area. It has it own problems like sometimes it may create graphs that cannot be solved (SELECT ST_Expand(ST_Extent(geom_way),0.1) as box ...


3

I finally came to the conclusion that it's best to put the whole graph (including indices) on a separate tablespace which permanently resides in memory using a ramdisk. For setting up the ramdisk on Ubuntu 13.04 I used the following instructions and must say it's working pretty good (it's includes instructions for reloading the data into memory after a ...


3

I have succeded in creating a WayTagResolver that parses the duration and puts it into the osm_meta column. I therefore share the solution here, for others to use this or deveelop futher on it. Download osm2po In the plugins folder, extract osm2po-plugins-4.7.7-src.zip Enter the extracted folder, and STAY there :) Create a java file for storing the ...


3

The FerryDurationResolver is absolutely correct. Good work! But you can make things easier. I assume you are using Eclipse. Then just create a new project. Add osm2po.jar as library and create a new Run-Config. Develop the FerryDurationResolver as usual. Debugging is possible. When everything works as expected, just create a jar-file using Eclipse's ...


3

Yes. osm2po provides two Router-Families. The DefaultRouter belongs to the first one, which is only able to route from link to link (Vertex-IDs). All Routers with an "Ovl" in their names are not restricted to it. They all base on a second virtual OverlayGraph which extends the static network. In order to find a virtual point (source and target) on the ...


3

In case you haven't tried it yet, the pgRouting Workshop is always a good place to get started. When you used osm2po to convert your OSM data, then source and target attributes are already there and ready to use. Sometimes the vertices table, that contains all source and target ID's, is useful to find the nearest vertex from a geographic point. The osm2po ...


3

I had the same problem few weeks ago and solved it by manually drawing lines from nearest node. I don't know if it's one and only resolution, it's quite hard and tricky but its working quite good. Firstly I'm selecting start edge, stop edge and result (path from routing) into record variables, then doing some post-procesing: Cut the result road if it's ...


3

The file osm2po.config, which can be obtained from the downloads tab on the osm2po page, contains a table with four column, defined as: 1) concurrent order 2) class (1-127) 3) default speed in kmh 4) allowed transportation type (optional) - since v4.5.30 And here are some sample rows, which I think explain where the 12, 51, etc, you are ...


3

Which osm2po version did you use and how (parameters?) did you start it? Hmmm... 74,660,756 of 235,414,299 sounds great. The rest are buildings, places, areas, boundary segments etc. and no routable roads or paths. May I see the complete log-file to find the ArrayIndexOutOfBounds-Exception? By the way: The error says, that one array has been populated with ...


3

Spotted this under the release notes The PgRoutingWriter has moved to the osm2po-plugins.jar which is open source. The writer is not enabled by default anymore. If needed, please edit (uncomment) the corresponding line in the osm2po.config or add it to the command line call. If you update your config file to remove the comment hashes from this ...


3

Indeed, the default.config is very strict and to be honest it's too strict for my taste. I stumbled across a similar question weeks ago and modified the osm2po release notes for 5.1.0 to report this issue. Your solution above is correct. But I think there are not so many more positive tags, It would be shorter to modify the deny-option instead to sth. like ...



Only top voted, non community-wiki answers of a minimum length are eligible