[postgis-tickets] [PostGIS] #3725: [raster] ST_Clip with multiple band raster throws exception when geometry only touches
PostGIS
trac at osgeo.org
Wed Mar 8 12:48:37 PST 2017
#3725: [raster] ST_Clip with multiple band raster throws exception when geometry
only touches
-------------------------+---------------------------
Reporter: yosukesabai | Owner: pramsey
Type: defect | Status: new
Priority: medium | Milestone: PostGIS 2.3.3
Component: postgis | Version: 2.3.x
Keywords: |
-------------------------+---------------------------
I realized that ST_Clip(raster, geometry) gives following error message
under particular condition:
ERROR: RASTER_clip: Could not get band from working raster
CONTEXT: PL/pgSQL function st_clip(raster,integer[],geometry,double
precision[],boolean) line 8 at RETURN
This happens, I think, when (1) raster has multi-band and (2) raster and
geometry (polygon) touches with no shared interior. Below is example sql
command for demo.
My version
version()\\
PostgreSQL 9.6.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.9.1,
64-bit
postgis_full_version()\\
POSTGIS="2.3.1 r15264" GEOS="3.6.0-CAPI-1.10.0 r0" PROJ="Rel. 4.9.3, 15
August 2016" GDAL="GDAL 2.1
.2, released 2016/10/24" LIBXML="2.9.4" LIBJSON="0.12.1" RASTER
{{{
-- This fails
SELECT ST_Summary(
ST_Clip(
ST_AddBand(
ST_MakeEmptyRaster(16, 16, 0, 0, 1, 1, 0, 0),
ARRAY[
ROW(1, '8BUI'::text, 0, 255),
ROW(2, '8BUI'::text, 0, 255),
ROW(3, '8BUI'::text, 0, 255)
]::addbandarg[]
),
ST_GeomFromText('POLYGON((16 0, 16 1, 17 1, 17 0, 16 0))')
)
);
}}}
--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3725>
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