1

I am working my way through the example in the pgRouting manual (2.2). After running pgr_createTopology() and pgr_analyzeGraph():

pgr_test=# SELECT pgr_createTopology('edge_table',0.001);
NOTICE: PROCESSING:
NOTICE: pgr_createTopology('edge_table', 0.001, 'the_geom', 'id', 'source', 'target', rows_where := 'true', clean := f)
NOTICE: Performing checks, please wait .....
NOTICE: Creating Topology, Please wait...
NOTICE: -------------> TOPOLOGY CREATED FOR 18 edges
NOTICE: Rows with NULL geometry or NULL id: 0
NOTICE: Vertices table for table public.edge_table is:
public.edge_table_vertices_pgr
NOTICE: ----------------------------------------------
pgr_createtopology
--------------------
OK
(1 row)

pgr_test=# select pgr_analyzeGraph('edge_table', 0.001);
NOTICE: PROCESSING:
NOTICE: pgr_analyzeGraph('edge_table',0.001,'the_geom','id','source','target','true')
NOTICE: Performing checks, please wait ...
NOTICE: Analyzing for dead ends. Please wait...
NOTICE: Analyzing for gaps. Please wait...
NOTICE: Analyzing for isolated edges. Please wait...
NOTICE: Analyzing for ring geometries. Please wait...
NOTICE: Analyzing for intersections. Please wait...
NOTICE: ANALYSIS RESULTS FOR SELECTED EDGES:
NOTICE: Isolated segments: 2
NOTICE: Dead ends: 7
NOTICE: Potential gaps found near dead ends: 1
NOTICE: Intersections detected: 1
NOTICE: Ring geometries: 0
pgr_analyzegraph
------------------
OK
(1 row)

So there are 2 isolated segments, which turn out to have id = 17, 18:

pgr_test=# SELECT a.* FROM edge_table a, edge_table_vertices_pgr b, edge_table_vertices_pgr c WHERE a.source=b.id AND b.cnt=1 AND a.target=c.id AND c.cnt=1;
id | dir | source | target | cost | reverse_cost | x1 | y1 | x2 | y2 | the_geom
----+-----+--------+--------+------+--------------+-----+-----+----------------+-----+------------------------------------------------------------------------------------
17 | B | 14 | 15 | 1 | 1 | 0.5 | 3.5 | 1.999999999999 | 3.5 | 010200000002000000000000000000E03F0000000000000C4068EEFFFFFFFFFF3F0000000000000C40
18 | B | 16 | 17 | 1 | 1 | 3.5 | 2.3 | 3.5 | 4 | 0102000000020000000000000000000C4066666666666602400000000000000C400000000000001040

The id=18 case is due to crossing and can be fixed later by pgr_nodeNetwork(), but the id=17 case is due to touching and I thought it should be handled by createTopology(), and it persisted even after pgr_nodeNetwork(). I tried bigger tolerance values to no avail. The manual says tolerance is in projection unit, but I don't know whether this is relevant for the sample data in the manual?

I am using pgRouting-2.2.0 on Windows with Postgresql-9.5, PostGIS-2.2.

  • I updated pgrouting to 2.2.2 but the problem is still there. – Huanchun Ye May 17 '16 at 21:08
1

The pgr_nodeNetwork code was modified on version 2.1 I confirm there is a bug on that modification.

SELECT pgr_nodeNetwork('edge_table', 0.001);
NOTICE:  PROCESSING:
NOTICE:  pgr_nodeNetwork('edge_table', 0.001, 'id', 'the_geom', 'noded', '<NULL>',  f)
NOTICE:  Performing checks, please wait .....
NOTICE:  Processing, please wait .....
NOTICE:    Splitted Edges: 2
NOTICE:   Untouched Edges: 16
NOTICE:       Total original Edges: 18
NOTICE:   Edges generated: 4
NOTICE:   Untouched Edges: 16
NOTICE:         Total New segments: 20
NOTICE:   New Table: public.edge_table_noded
NOTICE:  ----------------------------------
 pgr_nodenetwork 
-----------------
 OK
(1 row) 

where it reads

NOTICE:    Splitted Edges: 2

should be

NOTICE:    Splitted Edges: 3

I opened the following issue: https://github.com/pgRouting/pgrouting/issues/612

Will be fixed for next release on September, Thank you for noticing.

pgRouting team

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.