<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:"MS Gothic";
panose-1:2 11 6 9 7 2 5 8 2 4;}
@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;}
@font-face
{font-family:"\@MS Gothic";
panose-1:2 11 6 9 7 2 5 8 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.Shkpostityyli18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 2.0cm 70.85pt 2.0cm;}
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="FI" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">The right syntax is
</span><span lang="EN-US">average -srcnodata 32767 but you should </span><span lang="EN-US" style="mso-fareast-language:EN-US">not need to use it at all because GDAL recognizes nodata from your input automatically as you can see from the gdalinfo report. Could
you clip and share a small sample from your source data so that some nodata is included? You can use gdal_translate with -srswin or -projwin for that.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> gdal-dev <gdal-dev-bounces@lists.osgeo.org>
<b>Puolesta </b>Chao Li<br>
<b>Lähetetty:</b> maanantai 27. kesäkuuta 2022 4.09<br>
<b>Vastaanottaja:</b> gdal-dev@lists.osgeo.org<br>
<b>Aihe:</b> [gdal-dev] gdalwarp Resampling Input Raster Nodata Setting<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Dear GDAL experts,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I have a problem using <b>gdalwarp</b>.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I want to reproject a raster and change its resolution by the average method.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">This is the <b>gdalinfo</b> of the raster<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">[q70176a@ito-2 ~]$ gdalinfo DP12/11_RawData/02_GGP/Gross_PP_8Days_500m_v6/GPP/MOD17A2H_GPP_2016_001.tif Driver: GTiff/GeoTIFF<br>
Files: DP12/11_RawData/02_GGP/Gross_PP_8Days_500m_v6/GPP/MOD17A2H_GPP_2016_001.tif<br>
Size is 86400, 31200<br>
Coordinate System is:<br>
PROJCRS["unknown",<br>
BASEGEOGCRS["unknown",<br>
DATUM["unknown",<br>
ELLIPSOID["unknown",6371007.181,0,<br>
LENGTHUNIT["metre",1,<br>
ID["EPSG",9001]]]],<br>
PRIMEM["Greenwich",0,<br>
ANGLEUNIT["degree",0.0174532925199433,<br>
ID["EPSG",9122]]]],<br>
CONVERSION["Sinusoidal",<br>
METHOD["Sinusoidal"],<br>
PARAMETER["Longitude of natural origin",0,<br>
ANGLEUNIT["degree",0.0174532925199433],<br>
ID["EPSG",8802]],<br>
PARAMETER["False easting",0,<br>
LENGTHUNIT["metre",1],<br>
ID["EPSG",8806]],<br>
PARAMETER["False northing",0,<br>
LENGTHUNIT["metre",1],<br>
ID["EPSG",8807]]],<br>
CS[Cartesian,2],<br>
AXIS["easting",east,<br>
ORDER[1],<br>
LENGTHUNIT["metre",1,<br>
ID["EPSG",9001]]],<br>
AXIS["northing",north,<br>
ORDER[2],<br>
LENGTHUNIT["metre",1,<br>
ID["EPSG",9001]]]]<br>
Data axis to CRS axis mapping: 1,2<br>
Origin = (-20015109.353999998420477,7783653.637667000293732)<br>
Pixel Size = (463.312716527771215,-463.312716527787586)<br>
Metadata:<br>
AREA_OR_POINT=Area<br>
Image Structure Metadata:<br>
INTERLEAVE=BAND<br>
Corner Coordinates:<br>
Upper Left (-20015109.354, 7783653.638) (166d17' 5.25"W, 70d 0' 0.00"N)<br>
Lower Left (-20015109.354,-6671703.118) ( 0d 0' 0.00"E, 60d 0' 0.00"S)<br>
Upper Right (20015109.354, 7783653.638) (166d17' 5.25"E, 70d 0' 0.00"N)<br>
Lower Right (20015109.354,-6671703.118) ( 0d 0' 0.00"W, 60d 0' 0.00"S)<br>
Center ( -0.000, 555975.260) ( 0d 0' 0.00"W, 5d 0' 0.00"N)<br>
Band 1 Block=86400x1 Type=Int16, ColorInterp=Gray<br>
NoData Value=32767<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">This is the <b>gdalwarp</b> commend:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">[q70176a@ito-2 ~]$ gdalwarp -t_srs EPSG:4326 -te -180 -90 180 90 -tr 0.1 0.1 -ot Float64 -r average -srcnodata "32767" -multi -overwrite DP12/11_RawData/02_GGP/Gross_PP_8Days_500m_v6/GPP/MOD17A2H_GPP_2016_001.tif DP12/11_RawData/02_GGP/Gross_PP_8Days_500m_v6/GPP_01_test/test2.tif<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I also tried <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">[q70176a@ito-2 ~]$ gdalwarp -t_srs EPSG:4326 -te -180 -90 180 90 -tr 0.1 0.1 -ot Float64 -r average -srcnodata 32767 -multi -overwrite DP12/11_RawData/02_GGP/Gross_PP_8Days_500m_v6/GPP/MOD17A2H_GPP_2016_001.tif DP12/11_RawData/02_GGP/Gross_PP_8Days_500m_v6/GPP_01_test/test2.tif<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">However, the 32767 is not set to be nodata, and be averaged in the output raster.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">How can I set this? <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Additionally, I am using a HPC with multinodes. With 8 nodes, I have 288. If I set -multi and -wo NUM_THREADS=val/ALL_CPUS, will all that 288 run together?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Since there nothing returns, I really do not know.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Best regards.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">------------------------------------------------------------------------------------<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Mike Li<o:p></o:p></p>
<div>
<p class="MsoNormal">Department of Urban and Environmental Engineering<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Graduate School of Engineering<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Kyushu University<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">744 Motooka, Nishi-ku, Fukuoka 819-0395 Japan<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Tel: 090-8304-8953<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">E-mail: <a href="mailto:chaoli0394@gmail.com" target="_blank">
chaoli0394@gmail.com</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">-------------------------------------------------------------------------------------<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"MS Gothic"">李潮(リ チョウ)</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"MS Gothic"">九州大学 大学院 工学府 都市環境システム工学専攻</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"MS Gothic"">都市工学研究室</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">-------------------------------------------------------------------------------------<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>