Opened 22 months ago

Last modified 2 months ago

#5317 new defect

ST_Union(rast, uniontype) treat bands with different classes as the same as first band

Reported by: shenzhuxi Owned by: robe
Priority: medium Milestone: PostGIS 3.6.0
Component: raster Version: 3.0.x
Keywords: Cc:

Description (last modified by shenzhuxi)

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.

Change History (5)

comment:1 by shenzhuxi, 22 months ago

Description: modified (diff)

comment:2 by robe, 22 months ago

Component: postgisraster
Owner: changed from pramsey to robe

comment:3 by robe, 18 months ago

Milestone: PostGIS 3.3.3PostGIS 3.1.10

comment:4 by robe, 12 months ago

Milestone: PostGIS 3.1.10PostGIS 3.5.0
Version: 3.3.x3.0.x

comment:5 by robe, 2 months ago

Milestone: PostGIS 3.5.0PostGIS 3.6.0
Note: See TracTickets for help on using tickets.