[PostGIS] #6009: Error of ST_Polygon(raster) function in PostGIS 3.4.3 and 3.5.4

PostGIS trac at osgeo.org
Sun Nov 9 18:41:39 PST 2025


#6009: Error of ST_Polygon(raster) function in PostGIS 3.4.3 and 3.5.4
-------------------------+-------------------------------------------------
  Reporter:              |      Owner:  robe
  GISuser5432            |
      Type:  defect      |     Status:  new
  Priority:  high        |  Milestone:  PostGIS 3.5.5
 Component:  raster      |    Version:  3.5.x
Resolution:              |   Keywords:  PostGIS_Raster; Raster;
                         |  ST_Polygon(Raster)
-------------------------+-------------------------------------------------
Comment (by robe):

 You said in 3.6 the issue was fixed?  You mind spitting out the


 {{{
 SELECT postgis_full_version();
 }}}

 Of your 3.6 install.  I suspect the issue might be changes in GEOS or
 GDAL.  Cause I don't think we've touched the behavior of ST_Polygon in
 PostGIS raster for quite some time.

 Also I tested your above in PostGIS 3.4.2 that has a much newer GEOS and
 GDAL than yours:

 {{{
 POSTGIS="3.4.2 c19ce56" [EXTENSION] PGSQL="160" GEOS="3.15.0dev-
 CAPI-1.21.0" (compiled against GEOS 3.12.1) PROJ="9.6.0
 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org
 USER_WRITABLE_DIRECTORY=/tmp/proj DATABASE_PATH=/usr/share/proj/proj.db"
 GDAL="GDAL 3.8.4, released 2024/02/08" LIBXML="2.9.14" LIBJSON="0.18"
 LIBPROTOBUF="1.5.1" WAGYU="0.5.0 (Internal)" RASTER
 }}}

 and it gave no error and returned 3 rows of polygons. Although the result
 just looked like a square and checking the no data values, they don't seem
 to be in the range of the polygons as you can see from this query:


 {{{
 SELECT s.*, ST_BandNoDataValue(raster)
 FROM error_sounding_2m, ST_SummaryStats(raster) AS s;
 }}}


 So I'm surprised you are getting an error at all unless I'm missing a step
 in your processing


 {{{
  count |         sum         |        mean         |       stddev       |
 min         |         max         |   st_bandnodatavalue
 -------+---------------------+---------------------+--------------------+--------------------+---------------------+-------------------------
   2073 | -12315.960650817047 | -5.9411291127916295 | 1.1713853383330117 |
 -9.63054806077984 |  -3.606000026067098 | 1.7976931348623157e+308
   2073 | -12082.059349060059 |  -5.828296839874606 | 1.1384145955840472 |
 -9.571334838867188 | -3.5280160903930664 |  3.4028234663852886e+38
   2073 |  2164263.2647475842 |  1044.0247297383426 |  491.1311932725887 |
 2 |                2947 | 1.7976931348623157e+308
 (3 rows)
 }}}
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/6009#comment:2>
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