It doesn't grab adjacent tiles.  To consider adjacent tiles you'd need to use 
ST_Union to stitch together multiple tiles.

 

From: postgis-users [mailto:[email protected]] On Behalf Of 
David Haynes
Sent: Wednesday, June 13, 2018 12:56 PM
To: [email protected]
Subject: [postgis-users] raster operations

 

I have a question about how to focal operations for raster statistics are 
working. I started off comparing the old depreciated function 
st_mapalgebrafctngb with the current version st_mapalgebra. The difference I 
have determined is that the st_mapalgebrafctngb will pass the call back 
function to the raster dataset similar to the st_mapalgebra, but as the 
function approaches the edge of the raster tile things get wonky. What are 
values that are assigned to pixels that do not have sufficient neighbors? When 
I run this bit of code. The ST_Value function reports that no values have been 
assigned. I assume this can be remedied by adding information through userargs.

 

with smoothed_raster as

(

SELECT st_mapalgebrafctngb(rast, 1, NULL, 1, 1, 'st_mean4ma(double 
precision[][][],text,text[])'::regprocedure, 'ignore', NULL) as rast

FROM glc2000_clipped_250 r

WHERE r.rid = 25

), original_raster as

(

SELECT r.rast

FROM glc2000_clipped_250 r

WHERE r.rid = 25

)

SELECT x, y, ST_Value(s.rast, x,y) as smoothed, ST_Value(o.rast, x,y) as 
original

FROM smoothed_raster s, original_raster o

CROSS JOIN generate_series(1,10) as x

CROSS JOIN generate_series(1,10) as y

 

This leads me to a larger question regarding focal analysis functions for 
raster datasets. Do these functions cross the tiles? Assume you have 9 tiles 
and each tile is composed of 3x3 pixels. Tiles 1-3 in row 1, 4-6 row 2 etc. If 
you have a neighborhood analysis function performing on tile 5. Will it grab 
adjacent pixels in tile 6? Unfortunately the examples I created returned with 
the same result.

 

_______________________________________________
postgis-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/postgis-users

Reply via email to