[PostGIS] #6129: Missing area with topology.ST_GetFaceGeometry('arstat_2026_overlay_02_348',101383), but alle edges seems to be prensent

PostGIS trac at osgeo.org
Sat Sep 12 10:21:27 PDT 2026


#6129: Missing area with
topology.ST_GetFaceGeometry('arstat_2026_overlay_02_348',101383), but alle
edges seems to be prensent
--------------------------------+---------------------------
  Reporter:  Lars Aksel Opsahl  |      Owner:  strk
      Type:  defect             |     Status:  new
  Priority:  medium             |  Milestone:  PostGIS 3.6.5
 Component:  topology           |    Version:  3.6.x
Resolution:                     |   Keywords:
--------------------------------+---------------------------
Comment (by strk):

 One workaround to move on with data cleaning, in this specific case would
 be to add a single-segment edge from node 309 to node 310, so to form a
 new tiny face on the right of edge 304 (and left of the new edge), and
 then drop edge 304. Identifier numbers are those from the t6129.pgtopo
 export.

 But we can't add that single-segment new edge either because that edge 304
 has those 2 segments being almost coincidental and this introduces
 robustness problems, so we first need to add a vertex to 304, changing
 it's geom as in the below picture:

 [[Image(edge304-changed-geom.png)]]

 Then adding the new edge works:
 {{{
 # select ST_AddEdgeModFace('t6129', 309, 310, ( select
 ST_MakeLine(n1.geom, n2.geom) from t6129.node n1, t6129.node n2 where
 n1.node_id = 309 and n2.node_id = 310 ));
  st_addedgemodface
 -------------------
                385
 (1 row)
 }}}

 [[Image(new-edge-385.png)]]

 Then we remove the offending edge:
 {{{
 =# select st_remedgemodface('t6129', 304);
  st_remedgemodface
 -------------------
                 10
 (1 row)
 }}}

 [[Image(UpdatedProblematicAreaDetail.png)]]

 And finally we can get the proper area:
 {{{
 # select ST_Area(ST_GetFaceGeometry('t6129', 10));
         st_area
 -----------------------
  0.0002930648390859782
 (1 row)
 }}}

 Note that this method makes the face of intereset change identifier (from
 9 to 10 in this case) because ST_RemEdgeModFace keeps the identifier of
 the face on the right side, which in our case will be the new tiny face.
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/6129#comment:20>
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