Opened 11 years ago

Closed 3 months ago

#2586 closed defect (fixed)

[raster] ST_Clip with geometry smaller than pixel size

Reported by: dustymugs Owned by: dustymugs
Priority: high Milestone: PostGIS 3.5.0
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 (12)

comment:1 by dustymugs, 11 years ago

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 by robe, 11 years ago

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 by dustymugs, 10 years ago

Priority: mediumhigh

comment:4 by robe, 9 years ago

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 by pramsey, 7 years ago

Milestone: PostGIS 2.1.9PostGIS 2.2.6

comment:6 by pramsey, 7 years ago

Milestone: PostGIS 2.2.6PostGIS 2.2.7

comment:7 by robe, 7 years ago

Milestone: PostGIS 2.2.7PostGIS 2.5.0

comment:8 by robe, 6 years ago

Milestone: PostGIS 2.5.0PostGIS 2.4.5

comment:9 by pramsey, 6 years ago

Milestone: PostGIS 2.4.5PostGIS 2.4.6

comment:10 by robe, 6 years ago

Resolution: wontfix
Status: newclosed

comment:11 by robe, 6 years ago

Milestone: PostGIS 2.4.6PostGIS Fund Me
Resolution: wontfix
Status: closedreopened

comment:12 by robe, 3 months ago

Milestone: PostGIS Fund MePostGIS 3.5.0
Resolution: fixed
Status: reopenedclosed

I think this issue can be resolved now using the touched=true introduced in PostGIS 3.5.0 in #5496

Note: See TracTickets for help on using tickets.