Opened 4 years ago

Last modified 8 weeks ago

#2586 new defect

[raster] ST_Clip with geometry smaller than pixel size

Reported by: dustymugs Owned by: dustymugs
Priority: high Milestone: PostGIS 2.2.7
Component: raster Version: 2.1.x
Keywords: Cc:

Description

When using a geometry smaller than a single pixel, such as from the raster linked below, the returned raster from ST_Clip has no value.

ftp://tgftp.nws.noaa.gov/SL.us008001/ST.opnl/DF.gr2/DC.ndfd/AR.conus/VP.001-003/ds.maxt.bin

Change History (6)

comment:1 Changed 4 years ago by dustymugs

This occurs with a geometry that is sufficiently smaller than the pixel

ST_Multi(ST_Buffer('SRID=910001;POINT(624772 1534404)', 10))

The following geometry works.

ST_Multi(ST_Buffer('SRID=910001;POINT(624772 1534404)', 85))
WITH foo AS (
	SELECT ST_Multi(ST_Buffer('SRID=910001;POINT(624772 1534404)', 80)) AS geom
)
SELECT
	ST_DumpValues(ST_Clip(r.rast, foo.geom))
FROM test_raster r
JOIN foo
	ON ST_Intersects(r.rast, foo.geom)

The test raster was loaded with the following. The SRID is something user-specified for the projection of the raster.

raster2pgsql -s 910001 -t 1073x1 -R -C /tmp/ds.maxt.bin test_raster | psql

comment:2 Changed 4 years ago by robe

Milestone: PostGIS 2.1.2PostGIS 2.2.0

dustymugs -- push this back to 2.1.2 if you plan to get to it within next 2 weeks.

comment:3 Changed 3 years ago by dustymugs

Priority: mediumhigh

comment:4 Changed 2 years ago by robe

Milestone: PostGIS 2.2.0PostGIS 2.1.9

dutstymugs - push this back to 2.2.0 (or better yet do for 2.1.9 and 2.2.0) if you plan to have it in next couple of days.

comment:5 Changed 2 months ago by pramsey

Milestone: PostGIS 2.1.9PostGIS 2.2.6

comment:6 Changed 8 weeks ago by pramsey

Milestone: PostGIS 2.2.6PostGIS 2.2.7
Note: See TracTickets for help on using tickets.