pgrouting icon indicating copy to clipboard operation
pgrouting copied to clipboard

Orthogonal lines to road network are not noded with pgr_nodeNetwork

Open Latek opened this issue 8 years ago • 5 comments

Steps to reproduce the problem

Did: Data: OSM roads table, house points near the roads. Generated shortest lines from houses to roads using ST_ShortestLine(house_geom, road_geom) and inserted results to roads table. Use pgr_nodeNetwork with 0.001 tolerance on roads table to fabricate nodes and edges for pgRouting.

Expected behavior and actual behavior

Happened: On pgRouting version 2.0.0 lines and edges were generated correctly. All lines generated with ST_ShortestLine have one node in common with the road. On pgRouting 2.1.0 and 2.2.3 big amount of lines (about 30-50%) were separated from roads network (have no nodes in common with any road).

Expected: Every orthogonal line should have one node in common with road as it was in pgRouting ver. 2.0.0.

Notice: Apparently tolerance is not used in pgRouting ver. >= 2.1.0 to find and set up common (intersecting) nodes in case described above. Maybe this behavior has something common with the fact that generated lines not connected to network does not intersects with roads (checked using ST_Intersection). Even though line is not intersecting the road (mainly because of double precision issues) then tolerance in pgr_nodeNetwork should be used to determine wherever something is sufficiently close to be part of the network or not.

Specifications like the version of pgRouting/PostGIS and PostgreSQL as well as Operating System

Test succeeded on: Mac OSX: "PostgreSQL 9.4.1 on x86_64-apple-darwin, compiled by i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00), 64-bit" "POSTGIS="2.1.7 r13414" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.11.1, released 2014/09/24 GDAL_DATA not found" LIBXML="2.9.1" LIBJSON="UNKNOWN" TOPOLOGY RASTER" "(2.0.0,pgrouting-2.0.0,0,f26831f,master,1.59.0)" Linux: "PostgreSQL 9.4.8 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 5.2.1-22ubuntu2) 5.2.1 20151010, 64-bit" "POSTGIS="2.1.8 r13780" GEOS="3.5.0-CAPI-1.9.0 r4084" PROJ="Rel. 4.9.1, 04 March 2015" GDAL="GDAL 1.11.2, released 2015/02/10" LIBXML="2.9.2" LIBJSON="UNKNOWN" TOPOLOGY RASTER" "(2.0.0,pgrouting-2.0.0,0,f26831f,master,1.58.0)"

Test failed on: Mac OSX: "PostgreSQL 9.5.3 on x86_64-apple-darwin15.4.0, compiled by Apple LLVM version 7.3.0 (clang-703.0.31), 64-bit" "POSTGIS="2.2.2 r14797" GEOS="3.5.0-CAPI-1.9.0 r4084" PROJ="Rel. 4.9.2, 08 September 2015" GDAL="GDAL 1.11.3, released 2015/09/16" LIBXML="2.9.3" LIBJSON="0.12" RASTER" "(2.2.3,pgrouting-2.2.3,6d05b9b,master,1.60.0)" Linux: "PostgreSQL 9.3.12 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu 4.8.4-2ubuntu1~14.04.1) 4.8.4, 64-bit" "POSTGIS="2.1.2 r12389" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.1, released 2013/08/26" LIBXML="2.9.1" LIBJSON="UNKNOWN" TOPOLOGY RASTER" "(2.2.3,pgrouting-2.2.3,6d05b9b,master,1.54.0)"

Latek avatar Jul 12 '16 21:07 Latek

@Latek Can you please give use a small example with data so that we can try to reproduce the problem?

cvvergara avatar Jul 13 '16 05:07 cvvergara

@cvvergara example is zipped below in form of SQL scripts. Please run SQL scripts in the right order (files are named form 01_... to 03_...). The last script selects lines which are not correctly connected to roads network. pgr_nodenet_test.zip Please give me some feedback if this issue should be resolved.

Latek avatar Jul 14 '16 09:07 Latek

@Latek Before I try, I found this #612 about pgr_nodeNetwork. maybe it is the same problem, with different perspective of what you are talking about. I made changes to master (soon to be 2.2.4) & develop branch, fixing #612. Maybe the fix for #612 fixed this issue also. If you can try with current master branch, It would be of great help.

cvvergara avatar Jul 15 '16 02:07 cvvergara

General discussion on #419

cvvergara avatar Aug 24 '16 19:08 cvvergara

Not working on pgr_nodeNetwork for version 3.0

cvvergara avatar Jul 19 '19 18:07 cvvergara