[postgis-tickets] [PostGIS] #5390: TopologyException: side location conflict on ST_IsValid-geometry

PostGIS trac at osgeo.org
Fri May 26 01:11:01 PDT 2023


#5390: TopologyException: side location conflict on ST_IsValid-geometry
---------------------+--------------------------
 Reporter:  tjay     |      Owner:  pramsey
     Type:  defect   |     Status:  new
 Priority:  medium   |  Milestone:  PostGIS GEOS
Component:  postgis  |    Version:  3.1.x
 Keywords:           |
---------------------+--------------------------
 Hi,

 is there a safe way to perform ''ST_Intersects'' on the OGC-Valid-geometry
 in the following example, without raising the
 GEOSIntersects/TopologyException or altering the geometry?

 {{{
 DO $$
   DECLARE geom_a geometry := 'POLYGON((335645.7810000004
 5677846.65,335648.6579999998 5677845.801999999,335650.8630842535
 5677845.143617179,335650.77673334075 5677844.7250704905,335642.90299999993
 5677847.498,335645.7810000004 5677846.65))'::geometry;
   DECLARE geom_b geometry := 'POLYGON((335642.903 5677847.498,335642.894
 5677847.459,335645.92 5677846.69,335647.378 5677852.523,335644.403
 5677853.285,335644.374 5677853.293,335642.903 5677847.498))'::geometry;
 BEGIN
   IF NOT ST_IsValid(geom_a) OR NOT ST_IsValid(geom_b) THEN
     RAISE EXCEPTION 'geom_a / geom_b are not valid';
   END IF;
   PERFORM ST_Intersects(geom_a,geom_b);
 END $$;

 FEHLER:  GEOSIntersects: TopologyException: side location conflict at
 335642.90299999999 5677847.4979999997. This can occur if the input
 geometry is invalid.
 KONTEXT:  SQL-Anweisung »SELECT st_intersects(geom_a,geom_b)«
 PL/pgSQL-Funktion inline_code_block Zeile 8 bei PERFORM

 SELECT postgis_full_version();
 postgis_full_version
 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------
  POSTGIS="3.1.8 c5ebc1f" [EXTENSION] PGSQL="120" GEOS="3.11.2-CAPI-1.17.2"
 PROJ="9.2.0" LIBXML="2.9.7" LIBJSON="0.13.1" LIBPROTOBUF="1.3.0"
 WAGYU="0.5.0 (Internal)"
 (1 row)

 }}}
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5390>
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