[postgis-tickets] [PostGIS] #5317: ST_Union(rast, uniontype) treat bands with different classes as the same as first band

PostGIS trac at osgeo.org
Fri Jan 20 08:09:14 PST 2023


#5317: ST_Union(rast, uniontype) treat bands with different classes as the same as
first band
------------------------+---------------------------
  Reporter:  shenzhuxi  |      Owner:  pramsey
      Type:  defect     |     Status:  new
  Priority:  medium     |  Milestone:  PostGIS 3.3.3
 Component:  postgis    |    Version:  3.3.x
Resolution:             |   Keywords:
------------------------+---------------------------
Description changed by shenzhuxi:

Old description:

> POSTGIS="3.0.0 r17983" [EXTENSION] PGSQL="120" GEOS="3.8.0-CAPI-1.13.1 "
> PROJ="6.3.1" GDAL="GDAL 3.0.4
>
> Related to https://trac.osgeo.org/postgis/ticket/2200 ST_Union support
> multiple bands issue
>
> If the $RASTER has multiple bands like ARRAY['8BUI', '16BUI'], the result
> of
> {{{
>             ST_Union(
>               $RASTER,
>               ARRAY[
>                 ROW(1, 'SUM'),
>                 ROW(2, 'MAX')
>               ]::unionarg[]
>             )
> }}}
> will be like ARRAY['8BUI', ' 8BUI'].
>
> ST_Union always uses the first band class to process the 2nd band and
> ignore the original class.
>
> The same problem also can be triggered with ST_Union(setof raster rast,
> 2, text uniontype), if the first band is different from the second one.

New description:

 POSTGIS="3.0.0 r17983" [EXTENSION] PGSQL="120" GEOS="3.8.0-CAPI-1.13.1 "
 PROJ="6.3.1" GDAL="GDAL 3.0.4

 Related to https://trac.osgeo.org/postgis/ticket/2200 ST_Union support
 multiple bands issue

 If the $RASTER has multiple bands like ARRAY['8BUI', '16BUI'], the result
 of
 {{{
             ST_Union(
               $RASTER,
               ARRAY[
                 ROW(1, 'SUM'),
                 ROW(2, 'MAX')
               ]::unionarg[]
             )
 }}}
 will be treated like ARRAY['8BUI', ' 8BUI'] and the max value will be 254
 even the real value is a higher number in 16BUI.

 ST_Union always uses the first band class to process the 2nd band and
 ignore the original class.

 The same problem also can be triggered with ST_Union(setof raster rast, 2,
 text uniontype), if the first band is different from the second one.

--
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5317#comment:1>
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