Opened 2 months ago

Closed 6 weeks ago

#5801 closed defect (fixed)

Topology errors wih tolerance 1e-07 but not with 0

Reported by: Lars Aksel Opsahl Owned by: strk
Priority: medium Milestone: PostGIS 3.5.1
Component: topology Version: 3.4.x
Keywords: Cc:

Description

This is very rare case that I found among many hundred thousand polygons when moving 2400 temp topology's into the master topology.

First we import the attached topology like this

pgtopo_import -f topology_tmp_dyrkbarjord_12_037.gz tmp_dyrkbarjord_12_037|psql nibio_reg

Then we test that every thing is valid.

SELECT * FROM topology.ValidateTopology('tmp_dyrkbarjord_12_037');
NOTICE:  00000: Checking for coincident nodes
LOCATION:  exec_stmt_raise, pl_exec.c:3923
NOTICE:  00000: Checking for edges crossing nodes
LOCATION:  exec_stmt_raise, pl_exec.c:3923
NOTICE:  00000: Checking for invalid or not-simple edges
LOCATION:  exec_stmt_raise, pl_exec.c:3923
NOTICE:  00000: Checking for crossing edges
LOCATION:  exec_stmt_raise, pl_exec.c:3923
NOTICE:  00000: Checking for edges start_node mismatch
LOCATION:  exec_stmt_raise, pl_exec.c:3923
NOTICE:  00000: Checking for edges end_node mismatch
LOCATION:  exec_stmt_raise, pl_exec.c:3923
NOTICE:  00000: Checking for faces without edges
LOCATION:  exec_stmt_raise, pl_exec.c:3923
NOTICE:  00000: Checking edge linking
LOCATION:  exec_stmt_raise, pl_exec.c:3923
NOTICE:  00000: Building edge rings
LOCATION:  exec_stmt_raise, pl_exec.c:3923
NOTICE:  00000: Found 1911 rings, 1799 valid shells, 112 valid holes
LOCATION:  exec_stmt_raise, pl_exec.c:3923
NOTICE:  00000: Constructing geometry of all faces
LOCATION:  exec_stmt_raise, pl_exec.c:3923
NOTICE:  00000: Checking faces
LOCATION:  exec_stmt_raise, pl_exec.c:3923
NOTICE:  00000: Checked 1800 faces
LOCATION:  exec_stmt_raise, pl_exec.c:3923
NOTICE:  00000: Checking for holes coverage
LOCATION:  exec_stmt_raise, pl_exec.c:3923
NOTICE:  00000: Finished checking for coverage of 112 holes
LOCATION:  exec_stmt_raise, pl_exec.c:3923
NOTICE:  00000: Checking for node containing_face correctness
LOCATION:  exec_stmt_raise, pl_exec.c:3923
 error | id1 | id2 
-------+-----+-----
(0 rows)

Then we import the attached file not_ok_add.log, which have a lot close parallel lines.

psql nibio_reg -f not_ok_add.log

I see some topo errors in the log and we end up with invalid polygons

NOTICE:  00000: Found 7146 rings, 6984 valid shells, 161 valid holes
LOCATION:  exec_stmt_raise, pl_exec.c:3923
            error            |  id1   |  id2   
-----------------------------+--------+--------
 mixed face labeling in ring | -29943 | [NULL]

But if we import with same line using tolerance 0, I get no errors. (first starting from an empty data a new import off topology_tmp_dyrkbarjord_12_037.gz

psql nibio_reg -f ok_add.log

Right now I tested on

POSTGIS="3.5.0dev 3.4.0rc1-1272-g80806376a" [EXTENSION] PGSQL="160" GEOS="3.12.1-CAPI-1.18.1" PROJ="9.4.0 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=/Users/lop/Library/Application Support/proj DATABASE_PATH=/opt/homebrew/Cellar/proj/9.4.0/share/proj/proj.db" (compiled against PROJ 9.12.1) LIBXML="2.13.0" LIBJSON="0.17" TOPOLOGY

This relates to https://gitlab.com/nibioopensource/resolve-overlap-and-gap/-/issues/90

Attachments (3)

ok_add.log.gz (1.2 MB ) - added by Lars Aksel Opsahl 2 months ago.
not_ok_add.log.gz (1.2 MB ) - added by Lars Aksel Opsahl 2 months ago.
topology_tmp_dyrkbarjord_12_037.gz (1.3 MB ) - added by Lars Aksel Opsahl 2 months ago.

Change History (5)

by Lars Aksel Opsahl, 2 months ago

Attachment: ok_add.log.gz added

by Lars Aksel Opsahl, 2 months ago

Attachment: not_ok_add.log.gz added

by Lars Aksel Opsahl, 2 months ago

comment:1 by strk, 6 weeks ago

As of 3.6.0dev 3.5.0-73-g31a5529de I get an error upon loading the not-ok file:

psql:not_ok.sql:490: ERROR: Side-location conflict: new edge starts in face 0 and ends in face 19541

comment:2 by strk, 6 weeks ago

Resolution: fixed
Status: newclosed

Assuming fixed by recent robustness improvements (see #5792)

Note: See TracTickets for help on using tickets.