[pgrouting-users] "pgr_nodeNetwork" function is not working properly

​​Hi everyone,

I am using pgrouting on OpenStreetMap data and I want to node the network using the function “pgr_nodeNetwork function”, however the nodes are not created correctly. I am importing a large set of data to PostgreSQL in the following way:

BBOX=“8.944,45.830, 9.441,46.323”
wget --progress=dot:mega -O “roads_osm_viaregina.osm” “http://www.overpass-api.de/api/xapi?*[bbox=${BBOX}][@meta]

osm2pgrouting -file “/home/kilsedar/Desktop/DATA/roads_osm_viaregina.osm”
-conf “/usr/share/osm2pgrouting/mapconfig.xml”
-dbname pgrouting-viaregina
-user postgres \

-host localhost
-clean

At this point, if analyze the graph using pgr_analyzeGraph function by “SELECT pgr_analyzegraph(‘ways’, 0.001, ‘the_geom’, ‘gid’);” the result I am getting is the following:

NOTICE: ANALYSIS RESULTS FOR SELECTED EDGES:
NOTICE: Isolated segments: 86
NOTICE: Dead ends: 8172
NOTICE: Potential gaps found near dead ends: 7419
NOTICE: Intersections detected: 1159
NOTICE: Ring geometries: 12

Later if I run

“SELECT pgr_nodeNetwork(‘ways’, 0.001, ‘gid’, ‘the_geom’);”

“SELECT pgr_createTopology(ways_noded, 0.001);”

"SELECT pgr_analyzegraph(ways_noded, 0.001*)**;"*

I get the following result:

NOTICE: ANALYSIS RESULTS FOR SELECTED EDGES:
NOTICE: Isolated segments: 5
NOTICE: Dead ends: 958
NOTICE: Potential gaps found near dead ends: 329
NOTICE: Intersections detected: 5173

NOTICE: Ring geometries: 12

As you can see, the number of intersections increased, instead of descreasing.

NOTE: Somehow, by playing with the tolerance parameter and setting it to “0.000045” I decreased the number of intersections to 957, and the complete result is the following:

NOTICE: ANALYSIS RESULTS FOR SELECTED EDGES:
NOTICE: Isolated segments: 58

NOTICE: Dead ends: 7851
NOTICE: Potential gaps found near dead ends: 68
NOTICE: Intersections detected: 957
NOTICE: Ring geometries: 12

In the attachment, I am sending a screenshot of the same data in QGIS, where the bounding box is “9.265,46.108, 9.276,46.118” and the tolerance parameter is “0.001”. In this screenshot you can see that in some intersections, nodes are not created. It is trivial to see that red nodes are the ones that are created after noding.

Is it possible to identify the problem, or if the function is running correctly?

Thank you,

Regards,

Candan Eylul Kilsedar

Screenshot from 2015-03-12 15:02:13.png

This is a known problem and it has a pull request if you want to check it out:

https://github.com/pgRouting/pgrouting/issues/280
https://github.com/pgRouting/pgrouting/pull/282

-Steve

On 3/16/2015 12:41 PM, Candan Eylül Kilsedar wrote:

​​Hi everyone,

I am using pgrouting on OpenStreetMap data and I want to node the
network using the function "pgr_nodeNetwork function", however the nodes
are not created correctly. I am importing a large set of data
to PostgreSQL in the following way:

BBOX="8.944,45.830, 9.441,46.323"
wget --progress=dot:mega -O "roads_osm_viaregina.osm"
"http://www.overpass-api.de/api/xapi?*[bbox=$\{BBOX\}\]\[@meta\]"

osm2pgrouting -file "/home/kilsedar/Desktop/DATA/roads_osm_viaregina.osm" \
                           -conf "/usr/share/osm2pgrouting/mapconfig.xml" \
                           -dbname pgrouting-viaregina \
                           -user postgres \
   -host localhost \
                           -clean

At this point, if analyze the graph using pgr_analyzeGraph function by
"/SELECT pgr_analyzegraph('ways', 0.001, 'the_geom', 'gid');/" the
result I am getting is the following:

NOTICE: ANALYSIS RESULTS FOR SELECTED EDGES:
NOTICE: Isolated segments: 86
NOTICE: Dead ends: 8172
NOTICE: Potential gaps found near dead ends: 7419
NOTICE: Intersections detected: *1159*
NOTICE: Ring geometries: 12

Later if I run

/"SELECT pgr_nodeNetwork('ways', 0.001, 'gid', 'the_geom');"/

/"SELECT pgr_createTopology(ways_noded, 0.001);"/

/"SELECT pgr_analyzegraph(ways_noded, 0.001//)//;"/

I get the following result:

NOTICE: ANALYSIS RESULTS FOR SELECTED EDGES:
NOTICE: Isolated segments: 5
NOTICE: Dead ends: 958
NOTICE: Potential gaps found near dead ends: 329
NOTICE: Intersections detected: *5173*
NOTICE: Ring geometries: 12

As you can see, the number of intersections increased, instead of
descreasing.

NOTE: Somehow, by playing with the tolerance parameter and setting it to
"0.000045" I decreased the number of intersections to 957, and the
complete result is the following:

NOTICE: ANALYSIS RESULTS FOR SELECTED EDGES:
NOTICE: Isolated segments: 58
NOTICE: Dead ends: 7851
NOTICE: Potential gaps found near dead ends: 68
NOTICE: Intersections detected: 957
NOTICE: Ring geometries: 12

In the attachment, I am sending a screenshot of the same data in QGIS,
where the bounding box is "9.265,46.108, 9.276,46.118" and the tolerance
parameter is "0.001". In this screenshot you can see that in some
intersections, nodes are not created. It is trivial to see that red
nodes are the ones that are created after noding.

Is it possible to identify the problem, or if the function is running
correctly?

Thank you,

Regards,

Candan Eylul Kilsedar

_______________________________________________
Pgrouting-users mailing list
Pgrouting-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users