[PostGIS] #5801: Topology errors wih tolerance 1e-07 but not with 0

PostGIS trac at osgeo.org
Wed Oct 23 14:46:07 PDT 2024


#5801: Topology errors wih tolerance 1e-07 but not with 0
-------------------------------+---------------------------
 Reporter:  Lars Aksel Opsahl  |      Owner:  strk
     Type:  defect             |     Status:  new
 Priority:  medium             |  Milestone:  PostGIS 3.5.1
Component:  topology           |    Version:  3.4.x
 Keywords:                     |
-------------------------------+---------------------------
 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]
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5801>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list