[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    Re: [postgis-users] raster operations
From:       "Regina Obe" <lr () pcorp ! us>
Date:       2018-06-13 17:29:52
Message-ID: 000001d4033c$23b9fea0$6b2dfbe0$ () pcorp ! us
[Download RAW message or body]

This is a multipart message in MIME format.

[Attachment #2 (multipart/alternative)]
This is a multipart message in MIME format.


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:postgis-users-bounces@lists.osgeo.org] On Behalf Of David \
                Haynes
Sent: Wednesday, June 13, 2018 12:56 PM
To: postgis-users@lists.osgeo.org
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.

 


[Attachment #5 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type \
content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 \
(filtered medium)"><style><!-- /* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:12.0pt;
	font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#0563C1;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:#954F72;
	text-decoration:underline;}
span.gmail-m2033918191318644142cye-lm-tag
	{mso-style-name:gmail-m_2033918191318644142cye-lm-tag;}
span.cye-lm-tag
	{mso-style-name:cye-lm-tag;}
span.EmailStyle19
	{mso-style-type:personal-reply;
	font-family:"Calibri",sans-serif;
	color:#1F497D;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;}
@page WordSection1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" \
vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'>It doesn't \
grab adjacent tiles.   To consider adjacent tiles you'd need to use ST_Union to \
stitch together multiple tiles.<o:p></o:p></span></p><p class=MsoNormal><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D'><o:p>&nbsp;</o:p></span></p><div \
style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div \
style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p \
class=MsoNormal><b><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span \
style='font-size:11.0pt;font-family:"Calibri",sans-serif'> postgis-users \
[mailto:postgis-users-bounces@lists.osgeo.org] <b>On Behalf Of </b>David \
Haynes<br><b>Sent:</b> Wednesday, June 13, 2018 12:56 PM<br><b>To:</b> \
postgis-users@lists.osgeo.org<br><b>Subject:</b> [postgis-users] raster \
operations<o:p></o:p></span></p></div></div><p \
class=MsoNormal><o:p>&nbsp;</o:p></p><div><div><p class=MsoNormal><span \
class=gmail-m2033918191318644142cye-lm-tag><span style='font-size:9.5pt'>I have a \
question about how to focal operations for raster statistics are working. I started \
off comparing the old depreciated function&nbsp;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.</span></span><span \
style='font-size:9.5pt'><o:p></o:p></span></p></div><div><p class=MsoNormal><span \
style='font-size:9.5pt'><o:p>&nbsp;</o:p></span></p></div><div><p \
class=MsoNormal><span class=gmail-m2033918191318644142cye-lm-tag><span \
style='font-size:9.5pt'>with smoothed_raster as</span></span><span \
style='font-size:9.5pt'><o:p></o:p></span></p></div><div><p class=MsoNormal><span \
class=gmail-m2033918191318644142cye-lm-tag><span \
style='font-size:9.5pt'>(</span></span><span \
style='font-size:9.5pt'><o:p></o:p></span></p></div><div><p class=MsoNormal><span \
class=gmail-m2033918191318644142cye-lm-tag><span style='font-size:9.5pt'>SELECT \
st_mapalgebrafctngb(rast, 1, NULL, 1, 1, 'st_mean4ma(double \
precision[][][],text,text[])'::regprocedure, 'ignore', NULL) as \
rast</span></span><span style='font-size:9.5pt'><o:p></o:p></span></p></div><div><p \
class=MsoNormal><span class=gmail-m2033918191318644142cye-lm-tag><span \
style='font-size:9.5pt'>FROM glc2000_clipped_250 r</span></span><span \
style='font-size:9.5pt'><o:p></o:p></span></p></div><div><p class=MsoNormal><span \
class=gmail-m2033918191318644142cye-lm-tag><span style='font-size:9.5pt'>WHERE r.rid \
= 25</span></span><span style='font-size:9.5pt'><o:p></o:p></span></p></div><div><p \
class=MsoNormal><span class=gmail-m2033918191318644142cye-lm-tag><span \
style='font-size:9.5pt'>), original_raster as</span></span><span \
style='font-size:9.5pt'><o:p></o:p></span></p></div><div><p class=MsoNormal><span \
class=gmail-m2033918191318644142cye-lm-tag><span \
style='font-size:9.5pt'>(</span></span><span \
style='font-size:9.5pt'><o:p></o:p></span></p></div><div><p class=MsoNormal><span \
class=gmail-m2033918191318644142cye-lm-tag><span style='font-size:9.5pt'>SELECT \
r.rast</span></span><span style='font-size:9.5pt'><o:p></o:p></span></p></div><div><p \
class=MsoNormal><span class=gmail-m2033918191318644142cye-lm-tag><span \
style='font-size:9.5pt'>FROM glc2000_clipped_250 r</span></span><span \
style='font-size:9.5pt'><o:p></o:p></span></p></div><div><p class=MsoNormal><span \
class=gmail-m2033918191318644142cye-lm-tag><span style='font-size:9.5pt'>WHERE r.rid \
= 25</span></span><span style='font-size:9.5pt'><o:p></o:p></span></p></div><div><p \
class=MsoNormal><span class=gmail-m2033918191318644142cye-lm-tag><span \
style='font-size:9.5pt'>)</span></span><span \
style='font-size:9.5pt'><o:p></o:p></span></p></div><div><p class=MsoNormal><span \
class=gmail-m2033918191318644142cye-lm-tag><span style='font-size:9.5pt'>SELECT x, y, \
ST_Value(s.rast, x,y) as smoothed, ST_Value(o.rast, x,y) as \
original</span></span><span \
style='font-size:9.5pt'><o:p></o:p></span></p></div><div><p class=MsoNormal><span \
class=gmail-m2033918191318644142cye-lm-tag><span style='font-size:9.5pt'>FROM \
smoothed_raster s, original_raster o</span></span><span \
style='font-size:9.5pt'><o:p></o:p></span></p></div><div><p class=MsoNormal><span \
class=gmail-m2033918191318644142cye-lm-tag><span style='font-size:9.5pt'>CROSS JOIN \
generate_series(1,10) as x</span></span><span \
style='font-size:9.5pt'><o:p></o:p></span></p></div><div><p class=MsoNormal><span \
class=gmail-m2033918191318644142cye-lm-tag><span style='font-size:9.5pt'>CROSS JOIN \
generate_series(1,10) as y</span></span><span \
style='font-size:9.5pt'><o:p></o:p></span></p></div><div><p class=MsoNormal><span \
class=gmail-m2033918191318644142cye-lm-tag><span \
style='font-size:9.5pt'>&nbsp;</span></span><span \
style='font-size:9.5pt'><o:p></o:p></span></p></div><div><p class=MsoNormal><span \
class=gmail-m2033918191318644142cye-lm-tag><span style='font-size:9.5pt'>This leads \
me to a larger question regarding</span></span><span class=cye-lm-tag><span \
style='font-size:9.5pt'>&nbsp;</span></span><span \
class=gmail-m2033918191318644142cye-lm-tag><span style='font-size:9.5pt'>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.</span></span><span \
style='font-size:9.5pt'><o:p></o:p></span></p></div><p \
class=MsoNormal><o:p>&nbsp;</o:p></p></div></div></div></body></html>


[Attachment #6 (text/plain)]

_______________________________________________
postgis-users mailing list
postgis-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic