[PostGIS] #5927: ST_IsCollection throwing exception with large, complex MultiPolygon

PostGIS trac at osgeo.org
Fri Jun 20 11:42:21 PDT 2025


#5927: ST_IsCollection throwing exception with large, complex MultiPolygon
------------------------------------------+---------------------------
 Reporter:  dsavitsky                     |      Owner:  pramsey
     Type:  defect                        |     Status:  new
 Priority:  medium                        |  Milestone:  PostGIS 3.5.4
Component:  postgis                       |    Version:  3.5.x
 Keywords:  Multipolygon ST_IsCollection  |
------------------------------------------+---------------------------
 Steps to reproduce:

 1) Insert the attached MultiPolygon into a geometry field of a table.

 2) SELECT ST_IsCollection() on that field
   ERROR: Invalid subtype (Unknown) for collection type (MultiPolygon)

 Exception does not occur in PostGIS 3.4 or 3.1

 SELECT ST_IsCollection(ST_MakeValid()) produces a valid result

 ST_IsValid() returns true

 ST_IsCollection(ST_GeomFromText(<attached>, 4326) produces a valid result,
 as does ST_IsCollection('<attached>'::geometry). Exception only occurs
 when querying from a table.

 GeometryType and ST_GeometryType both return valid results



 PostgreSQL 16.8 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 11.5.0
 20240719 (Red Hat 11.5.0-5), 64-bit

 POSTGIS="3.5.2 dea6d0a" [EXTENSION] PGSQL="160" GEOS="3.13.1-CAPI-1.19.2"
 PROJ="9.5.1 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org
 USER_WRITABLE_DIRECTORY=/home/postgres/.local/share/proj
 DATABASE_PATH=/usr/proj95/share/proj/proj.db" (compiled against PROJ
 9.5.1) LIBXML="2.9.13" LIBJSON="0.14" LIBPROTOBUF="1.3.3" WAGYU="0.5.0
 (Internal)"
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5927>
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