Opened 2 months ago

Last modified 2 months ago

#3730 new defect

[raster] ST_Clip fails when polygon barely intersects with raster

Reported by: yosukesabai Owned by: dustymugs
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 (1)

comment:1 Changed 2 months ago by robe

Component: postgisraster
Owner: changed from pramsey to dustymugs
Note: See TracTickets for help on using tickets.