#1752 closed enhancement (fixed)
[raster] ST_Neighborhood
Reported by: | dustymugs | Owned by: | dustymugs |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.1.0 |
Component: | raster | Version: | master |
Keywords: | history | Cc: |
Description
Along with ST_NearestValue(), a related function is to get the all pixels within N pixel distance from a specific pixel (excluding the specific pixel). The function returns a set of records (x, y, pixel value) that can used for additional processing…
ST_Neighborhood( rast raster, band integer, ix integer, iy integer, distance integer, exclude_nodata_value boolean DEFAULT TRUE, OUT x integer, OUT y integer, OUT val double precision ) -> SETOF record
distance: value greater than zero denoting the size of the neighborhood around the specified pixel. So a value of 4 would be all pixels within the box made by 4 pixels to the left of, 4 pixels to the right of, 4 pixels above and 4 pixels below the specific pixel
ST_Neighborhood( rast raster, ix integer, iy integer, distance integer, exclude_nodata_value boolean DEFAULT TRUE, OUT x integer, OUT y integer, OUT val double precision ) -> SETOF record
ST_Neighborhood( rast raster, band integer, pt geometry, distance integer, exclude_nodata_value boolean DEFAULT TRUE, OUT x integer, OUT y integer, OUT val double precision ) -> SETOF record
ST_Neighborhood( rast raster, pt geometry, distance integer, exclude_nodata_value boolean DEFAULT TRUE, OUT x integer, OUT y integer, OUT val double precision ) -> SETOF record
Change History (7)
comment:1 by , 13 years ago
Status: | new → assigned |
---|
comment:2 by , 13 years ago
comment:3 by , 13 years ago
Would the following work?
SELECT ST_Max4Ma((ST_Neighborhood(rast, 1, 3.14)).val)
The format of returning a set of (x, y, val) is so that someone could go nuts with the results, such as weighted averages based upon distance.
comment:4 by , 13 years ago
After looking at the ST_xx4ma functions, I adjust the output of the ST_Neighborhood to double precision[][] since I haven't started using ST_Neighborhood for my in-house needs.
comment:6 by , 13 years ago
Keywords: | history added |
---|---|
Milestone: | PostGIS Future → PostGIS 2.0.1 |
comment:7 by , 13 years ago
Milestone: | PostGIS 2.0.1 → PostGIS 2.1.0 |
---|
Could the result be formatted properly so that we can pass it directly to one of the st_…4ma already existing functions?
SELECT ST_Max4Ma(ST_Neighborhood(rast, 1, 3.14))
?