Opened 13 years ago
Closed 13 years ago
#1889 closed enhancement (fixed)
[raster] ST_PixelOfValue: given a band and value, get the band pixels with that value
Reported by: | dustymugs | Owned by: | dustymugs |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.1.0 |
Component: | raster | Version: | master |
Keywords: | Cc: |
Description
As per the discussion in…
http://postgis.refractions.net/pipermail/postgis-users/2012-June/034611.html
It would be nice to have a function able to return the pixel coordinates of a user-specified value.
ST_PixelofValue( rast raster, nband integer, pixval double precision[], exclude_nodata_value DEFAULT true, OUT val double precision, OUT x integer, OUT y integer ) -> setof record ST_PixelofValue( rast raster, nband integer, pixval double precision, exclude_nodata_value DEFAULT true, OUT x integer, OUT y integer ) -> setof record
Change History (3)
comment:1 by , 13 years ago
comment:2 by , 13 years ago
You're correct. That would be very similar (though I don't see ST_PixelAsPoints() anywhere). ST_PixelofValue should be fast
Note:
See TracTickets
for help on using tickets.
I find this is very similar to adding a WHERE clause to ST_PixelAsPoints…
SELECT (gv).geom FROM (SELECT (ST_PixelAsPoints(rast)).geom geom
WHERE (gv).val = 1234
ST_PixelofValue might be faster though…