[PostGIS] #6149: ST_Buffer produces invalid geometry

PostGIS trac at osgeo.org
Fri Oct 23 16:16:16 PDT 2026


#6149: ST_Buffer produces invalid geometry
------------------------+--------------------------
 Reporter:  turntwo463  |      Owner:  pramsey
     Type:  defect      |     Status:  new
 Priority:  high        |  Milestone:  PostGIS GEOS
Component:  postgis     |    Version:  3.6.x
 Keywords:  ST_Buffer   |
------------------------+--------------------------
 ST_Buffer generates invalid geometry (Ring Self-intersection) with
 join=mitre and mitre_limit=2.0

 Problem Description
 An issue has been identified where `ST_Buffer` generates an invalid
 geometry output from a valid input `MULTIPOLYGON` when using specific
 mitre join parameters.

 When running `ST_Buffer` with `join=mitre` and a tight `mitre_limit=2.0`
 on a valid input geometry, the resulting buffered geometry evaluates to
 invalid. This behavior is verified via `ST_IsValidReason`.

 Minimal Reproducible Example

 sql

 {{{



 WITH input AS (
     SELECT ST_GeomFromEWKT(
         'SRID=32611;MULTIPOLYGON (((412296.71017229463905096
 3756111.80936163989827037, 412346.39029745210427791
 3756111.41585569828748703, 412346.30981545645045117
 3756094.91704659396782517, 412298.91675710305571556
 3756095.32125178258866072, 412298.92135208309628069
 3756095.29999999981373549, 412296.790314826881513
 3756095.29999999981373549, 412296.71017229463905096
 3756111.80936163989827037)))'
     ) AS geom
 )
 SELECT
     ST_IsValid(geom) as input_valid,
     ST_Buffer(
         geom,
         2,
         'join=mitre endcap=square mitre_limit=2.0'
     ) AS buffered_geom,
     ST_IsValidReason(ST_Buffer(
         geom,
         2,
         'join=mitre mitre_limit=2.0'
     )) AS valid_detail
 FROM input;
 }}}

 Observed Output
 *   **input_valid**: `true`
 *   **ST_IsValidReason output**:
     ```text
     Ring Self-intersection[412301.399999998 3756093.3]
     ```

 System Environment Details
 *   **PostgreSQL Version:** 16.11 (Compiled by Visual C++ build 1944,
 64-bit)
 *   **PostGIS Version:** 3.6.1 (3.6.1 Extension)
 *   **GEOS Version:** 3.14.1-CAPI-1.20.5
 *   **PROJ Version:** 8.2.1 (Network Enabled: OFF)
 *   **GDAL Version:** 3.9.2 (Released 2024/08/13)
 *   **WAGYU Version:** 0.5.0 (Internal)
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/6149>
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