Tag Info

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


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

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


3

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


3

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


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

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


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

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


2

I guess you mean something like this: Create a symbol with one line layer and two marker layers. Put the markers on the first and on the last vertex:


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


2

I do not think that you can rely on the nearest vertex. Imagine source and target are located on the same edge close to the same vertex. You'd rather considered three! different cases: a vertex is the nearest point. a form node of the edge is the right one the edge-line itself is nearer. (orthogonal)


2

the reason is simple: Some fool has tagged this street as "tertiary_link", which is nonsense. Regards, Carsten. PS: I've just corrected it in JOSM. With reference to your question in the comment... I don't know how Geofabrik interprets unknown tags. Anyway, osrm is based on an algo developed in Karlsruhe, Germany. Guess where Geofabrik have their main ...


2

It's easy. Let's regard these lines: wtr.tag.highway.secondary_link = 1, 22, 30, car wtr.tag.highway.tertiary = 1, 31, 40, car|bike Setting wtr.finalMask = car imports both road types, setting wtr.finalMask = bike imports the tertiary road only. Actually car|bike are values (1+2=3) in the flags-column. It's derived from the wtr.flagList = car, ...


2

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


2

There are two aproaches. So, firstly decide whether you need static or dynamic data. For the latter it is necessary to overwrite the Java-API. I think this is a static problem, meaning, the costs can be precalculated. What you need is a different configuration. In your scenario the speed is never used. So why not regarding it as "your" costs. And if I see ...


2

Just a guess. Did you use an uppercase letter in osm2po prefix name? It looks like yes - try to rename prefix/table name from "wmCar_2po_4pgr" to "wmcar_2po_4pgr". It helped me in similar situation - error while loading osm2po routing sql-script into PostgreSQL


2

I have done it the way you are discussing, though I borrowed this algorithm instead of the one you're using. http://code.activestate.com/recipes/119466-dijkstras-algorithm-for-shortest-paths/ I've also processed OSM to make it routeable and can vouch for osm2po. It does work well with Dijksra's algorithm and saves you a lot of time. A* is an ...


2

I actually figured out how to do this by myself. The first thing that confused me was how can one node only have one target node, hence can only go in one direction. The answer is it doesn't. Firstly, in the database there can be multiple rows for a single source node, ie one for each edge going out from that node. Secondly, when you build a network using ...


2

Actually, osm contains disconnected nodes. Additionally there are nodes which can only be reached from one direction but not reverse. This is the case where oneways have been clipped at border regions of your extract. You see, there is no guarantee for A->B => B->A. Nevertheless, the routing itself should give you the answer whether a route is valid or not. ...


2

package de.cm.osm2po.test; import java.io.File; import java.util.Arrays; import de.cm.osm2po.logging.Log; import de.cm.osm2po.logging.Log2poConsoleWriter; import de.cm.osm2po.model.LatLon; import de.cm.osm2po.routing.Graph; import de.cm.osm2po.routing.MultiTargetRouter; import de.cm.osm2po.routing.PoiRouter; public class MatrixDemo { // ...


2

What kind of polygons are you thinking of? ConvexHull, Alphashapes, IsoLines? ... osm2po returns either a cloud of visited vertexes or the convex hull. Here is the exact copy from the osm2po-online-help-page: It is possible to calculate a route in osm2po, output the result as GeoJson and to add it as a layer in QuantumGIS. * Convert the graph file with ...


2

Yes, since version 4.6.9 it's possible. Convert NewYork and SanFrancisco separately, but use cmd=tj which processes phase 1 and 2 of osm2po's conversion chain only. Don't forget to set a meaningful prefix parameter for both, e.g. prefix=ny for NewYork. Use the same tileSize parameter for everything you are going to merge. The steps above result in two ...


2

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


1

cmd=fh (findHull) Example 1 (2km circle) http://localhost:8888/Osm2poService?cmd=fh&source=11473&findShortestPath=true&maxCost=2.0&format=geojson Example 2 (12 minutes circle) http://localhost:8888/Osm2poService?cmd=fh&source=11473&findShortestPath=false&maxCost=0.2&format=geojson


1

I have already played around with tolls in osm2po. Days! But it's not that easy. In OSM there are points tagged as toll-booths and toll-roads! In order to complicate things, some people have created polygons (buildings) tagged as toll-stations, which span over many lanes but are not connected to the network. Nevertheless, osm2po can take points and roads ...



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