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


5

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

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

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

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

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

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


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

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


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

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

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


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

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


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


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'm going to explain the solution that I've found (perhaps don`t be the best). According to the post image, let's suppose that we are in Point A and we gonna go to Point B. As I explained above this points aren`t vertex (source/targets in table generated with osm2po tool). Due to this, we need to know the walking/driving direction. If we go from nearest ...


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


1

No. (Not yet). But if you can give me a good use case, I will think about it. Alternatively use the returned SegmentId for Database-lookups. The value corresponds to the ID-Field in the 2po-table where all corresponding osm-IDs are in. Nevertheless, osm2po-IDs change because OSM-IDs do as well.


1

Only matched booleans make any sense. Unmatched ones are either irrelevant or 'broken': FALSE FALSE: Undirected graphs (“directed false”) ignore “has_reverse_cost” setting, which means you can travel in both directions between any pair of nodes and the cost is the same both ways. TRUE TRUE: This is a directed graph and the cost of reverse travel is taken ...


1

you actually caught me on the wrong foot ;-) junction=roundabout needs some (hard coded) extra handling with reference to the oneways. Because of this fact, I've mistakenly isolated it in an else-block where the configuration could not override it. This will be fixed in the next version. THX!!! Nevertheless, junction=roundabout is not a main-tag. It's an ...


1

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


1

osm2po exports data compatible with pgRouting's shortestpath and shortestpathastar. Hence turn restrictions are not directly supported. But there is a hidden feature which at least give you some more information: Have a look into the osm2po.config file and search for this line: #postp.2.class = de.cm.osm2po.plugins.PgVertexWriter uncomment it by removing ...


1

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



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