Opened 8 years ago
Closed 8 years ago
#3730 closed defect (fixed)
[raster] ST_Clip fails when polygon barely intersects with raster
Reported by: | yosukesabai | Owned by: | robe |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.3.3 |
Component: | raster | Version: | 2.3.x |
Keywords: | Cc: |
Description
It would be better if this returns one pixel, or nothing at all. Currently it throws ERROR and I found hard to handle the error in PG/SQL.
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[] ) -- this works --, ST_GeomFromText('POLYGON((15.999999 15.999999, 15.999999 17, 17 17, 17 15.999999, 15.999999 15.999999))') -- this fails , ST_GeomFromText('POLYGON((15.9999999 15.9999999, 15.9999999 17, 17 17, 17 15.9999999, 15.9999999 15.9999999))') ) );
Change History (5)
comment:1 by , 8 years ago
Component: | postgis → raster |
---|---|
Owner: | changed from | to
comment:2 by , 8 years ago
Owner: | changed from | to
---|
comment:3 by , 8 years ago
comment:4 by , 8 years ago
I changed this from Erroring to just providing a NOTICE and returning NULL as it was before.
I notice that when the geometry doesn't intersect the raster, it returns an empty raster, but I'm not sure under what other conditions clip can not compute a raster, so I left it as returning null.
We might want to revisit this in PostGIS 2.4 to see if we can revise ST_Clip to have an option of returning a single pixel if there is a partial pixel overlap. I think right now if there is a partial pixel overlap, it doesn't return the pixel.
comment:5 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
fixed at r15457 for PostGIS 2.3.3
In 15456: