pgrouting
pgrouting copied to clipboard
pgr_nodeNetwork does not correctly split line segments
pgr_nodeNetwork does not cut intersections on intersecting points. Consider the following simple case of two segments crossing on (5,5) :
create table network (id int, the_geom geometry(linestring) ); insert into network values (1, 'linestring(0 0, 10 10)'::geometry); insert into network values (2, 'linestring(2 0, 8 10)'::geometry); select pgr_nodeNetwork('network', 0.001);
The "network_noded" table then contains 4 geometries : LINESTRING(0 0,1 1) <-- the first segment split on what seems to be the projection of the starting point of the second segment (?) LINESTRING(1 1,9 9) <-- split on the projection of the ending point of the second segment LINESTRING(9 9,10 10) LINESTRING(2 0,8 10) <-- the original second segment
It should split the two geometries on (5,5)
I have found the problem. Change in pull #282 solves the example correctly.
Vicky, Please review this pull request (when you have a chance) and make sure that it works as you intended the code to work. We might need more test cases added to it. Thanks.
Small update on pull #282 There were problems when paths intersect at more than one point. A test with 297023 lines of OSM data revealed no problems.
+1 to issue.
I've applied the #282 manually in my system, but it doesn't help -- original linestrings still are splitted the very strange way.
Sorry, @yobiSource, I didn't apply fix correctly, the #282 actually works good.
Main discussion in #419
This bug is still active, I just reproduced it in both PGR 2.4.1 and 2.50 (using Postgres 9.6.5 and PostGIS 2.3.2)
@fitnr Yes, its still active, I haven't got time to rewrite pgr_nodeNetwork. This function has too many bugs that needs a full rewrite.
@cvvergara Can I suggest adding a "known bugs" section to the readme and docs?
Well, its in the list of issues, so they are known.
But a Readme like this one can be done: https://github.com/pgRouting/pgrouting/tree/master/doc/trsp Note that, that readme is generated from executing the actual queries: https://github.com/pgRouting/pgrouting/blob/master/src/trsp/test/trsp_notes_v2.5.0.test.sql So, its a script that demonstrates the bugs.
If you make a PR that works like that and pinpoints the bugs, it would be cool.
Not working on pgr_nodeNetwork
for version 3.0