Hot answers tagged

17

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


7

In PgRouting 2.0 there is a pgr_analyzeGraph function that will identify isolated segments. Isolated segments will have a dead-end at each end so a query like this against your network and vertices tables: SELECT * FROM mytab a, mytab_vertices_pgr b, mytab_vertices_pgr c WHERE a.source=b.id AND b.cnt=1 AND a.target=c.id AND c.cnt=1; will identify ...


6

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. cluster on geom column 5. analyze for my _4pgr and _vertex tables, only the source and target columns had indexes after the import (osm2po-core-5.1.0).


6

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


5

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


5

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


4

GDAL can only read pbf files, so no chance to write it with GDAL or QGIS. Osmosis is able to read from a postgis database and write to pbf, but only for its own snapshot or simple data scheme. These schemes use nodes, ways and relations (like they are stored in the OSM database), while a "usual" Postgis data scheme uses points, lines, multilines, polygons ...


4

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


4

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


3

As for the flags, I just wrote up a little explanation here. I wish I would have figured the flags out a while ago! Very useful, and a clever encoding.


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

After analyzing my dataset more with QGIS I think I've found most of the differences. Using osm2pgrouting with mapconfig_for_cars.xml still includes vertices related to pedestrian interaction, whereas osm2po with wtr.finalMask = car does not. Here is a view of OSM of an intersection with crosswalks... Here is a view of my dataset (which is roads only) ...


3

Yes, there are memory limits and processing in chunks is faster. It's hard to say how big chunks you should use. Apart from processing in smaller parts you should also consider following: Make sure you have proper indices on your tables Increase shared_buffers and work_mem Change the function. If you're using this function there's much room for improvment,...


3

Just join the geometry column from the original edge table which holds the geometry column. Your query will look like this: SELECT t1.seq, t1.id1 AS Node, t1.id2 AS Edge, t1.cost, t2.geometry FROM PGR_DrivingDistance( 'SELECT id, source, target, cost FROM edge_table', 1, 10, false, false) t1, edge_table t2 WHERE t1.id2 = t2.edge_id If you want the ...


3

This looks like what you are trying to do -- take a look at it. The example below uses the old name http://trac.osgeo.org/postgis/wiki/UsersWikiSplitPolygonWithPoints Anyrate the key is using ST_LineSubString - http://postgis.net/docs/manual-2.1/ST_LineSubstring.html Also as noted by user30184 once you do this, the nodes created by osm2po would be no good....


3

Ok, there are three possible reasons: the file does not have a .pbf extension the plugins.jar could not be found the file itself is corrupt


3

I guess that you took the example createTopology function which is shown for WGS84 geometries, using degrees as a projection unit. 0.00001 degree tolerance means that your points have to be less than 1.19 meters away from each other to be connected. As seen here : https://epsg.io/900913 The system that you're using uses meter as projection unit. Which ...


3

These columns are created by osm2po based on your osm2po.config file. These specific columns and values are not contained in OSM! They are constructed based on certain rules that osm2po assumes and that are found in the osm2po.config file. Some of these values are explained at What does the values in column clazz (osm2po) mean?. Note that osm2po is a ...


2

You have may have to call create extension postgis again if this is not caused by uppercase prefix for you, because 'AddGeometryColumn' requires postgis and if it fails to run, the error will look the same on insert.


2

osm2po only takes roads into account, that are listed (and not commented out) in the configuration file. Did you take a look?


2

As I remember isochrone is not a set of roads reachable in certain time, but polygon containing all of that roads, so in this case you have to get familiar with two functions: ST_ConvexHull and ST_ConcaveHull. First is like placing something in a rubber baloon, second is like apply suction to this baloon. To store it in the table of isochrones you have to ...


2

The answer is laid out by Carsten in this post and comments: How to speed up osm2po when using as java lib? I used the same code from Carsten's answer and just modified the last for loop to look like this. Works like a charm. for (int z = 0; z < n; z++) { int x = z + y; if (x >= n) x -= n; matrix[y][x] = -1; ...


2

Hmmm... no answers here ... Ok... look for this line inside the config and comment it out: postp.1.class = de.cm.osm2po.plugins.PgVertexWriter This will give you an additional table of vertices. Look for the ref_count-column. A value of "0" indicates dead ends or "no crossing". But what are you going to interpret in your example above if it's composed of ...


2

If instead single isolated segments, you need to identify sub-graphs that are isolated from the rest of the graph, then using pg_routing pgr_connectedComponents() function will separate all nodes into connected sub-groups (components). You can then see which component represents the bigger sub-group of the graph (hopefully component=1), and see what is ...


2

Since you mentioned using QGIS, I had a similar problem, so I developed a QGIS plugin which is now available in the official QGIS plugins repository and can be found in the QGIS menu: Plugins / Manage and Install Plugins... and search for Disconnected Islands. http://plugins.qgis.org/plugins/disconnected-islands/ This plugin runs on a polyline layer, ...


2

From the osm2po.config file: road type clazz motorway 11 motorway_link 12 trunk 13 trunk_link 14 primary 15 primary_link 16 secondary 21 secondary_link 22 tertiary 31 tertiary_link 32 residential 41 road 42 unclassified 43


2

You are going to split at each point? This may produce tons of data! Yes, osm2po can do that. Usually osm2po splits at intersections or at important nodes such as levelcrossings if necessary. The trick is, to give these nodes an importance. Namely, by setting the Node-Clazz >0. A good example of how to do it you'll find inside the plugins-source-zip. ...


2

The parameter you are looking for is service.domain. Either change it in the osm2po.config-File or pass it on the command line java ... osm2po.jar ... service.domain=192.168.1.5


2

Responsible for the value U receive is the DefaultGraphBuildInterceptor. The current implementation does the following: @Override public int getFlags(SegmentedWay way, int segmentIdx, boolean reverse) { Node[] nodes = way.getSegments()[segmentIdx].getNodes(); Node targetNode = reverse ? nodes[0] : nodes[nodes.length -1]; int wayClazz = way....


2

pgRouting queries are as faster as smaller your selected road network is. And it's as slower s larger your selected road network is. Your selection is the first argument of the pgr_dijkstra function: SELECT id, source, target, cost FROM pgr_2po_4pgr; So you see, that you select all records of your network table pgr_2po_4pgr, even if your start and end ...


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