<div dir="ltr">Hi,<div><br></div><div>You are right but when I try to check the data processing, there is no any compression. On my computer, it is similar to your situation. I guess most nodata values are over 32760, so maybe I can list all of them.</div><div><br></div><div>-srcnodata <32760 32761 32762 32763 32764 32765 32766 32767>. Is this the right way?</div><div><br></div><div>Thank you.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Rahkonen Jukka <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi">jukka.rahkonen@maanmittauslaitos.fi</a>> 于2022年6月27日周一 18:14写道:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="FI" style="overflow-wrap: break-word;">
<div class="gmail-m_-6292610455330913811WordSection1">
<p class="MsoNormal"><span>Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">Please send answers as reply-to-all so they will go also to the gdal-dev mailing list.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">There is something odd in the source data. As you can see from the attached image there are pixels which are close to the nodata
</span><span lang="EN-US">32767 but not exactly. Huge areas have value 32766 but here and there I can also see values 32765, 32762 etc. The point in the image is at EPSG:4326
</span><span lang="EN-US">97.30902,5.18109.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">I think that the source data that you clipped for the test is somehow corrupted. Could you check if you can find similar pixel values from the original image? The sample is LZW compressed
but could it be that at some moment the image has been compressed with JPEG or some other lossy method?
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US">-Jukka Rahkonen-<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> Chao Li <<a href="mailto:chaoli0394@gmail.com" target="_blank">chaoli0394@gmail.com</a>> <br>
<b>Lähetetty:</b> maanantai 27. kesäkuuta 2022 11.29<br>
<b>Vastaanottaja:</b> Rahkonen Jukka <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi" target="_blank">jukka.rahkonen@maanmittauslaitos.fi</a>><br>
<b>Aihe:</b> Re: [gdal-dev] gdalwarp Resampling Input Raster Nodata Setting<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Now, seemingly, it works. I am also able to get output raster, but once you visualize this raster you will find that the boundaries between value and nodata zones are abnormal. There might be over 20,000. <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">However the valid values are no more than 1000. That’s my problem.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Could please check whether you have the same problem?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Thank you.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">Rahkonen Jukka <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi" target="_blank">jukka.rahkonen@maanmittauslaitos.fi</a>><span style="font-family:"MS Gothic"">于</span>2022<span style="font-family:"MS Gothic"">年</span>6<span style="font-family:"MS Gothic"">月</span>27<span style="font-family:"MS Gothic"">日</span>
<span style="font-family:"MS Gothic"">周一</span>17:17<span style="font-family:"MS Gothic"">写道:</span><u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">It seems to work for me with GDAL 3.6.0dev on Windows.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">gdalwarp -t_srs EPSG:4326 -r average -ot float64 -multi MOD17A2H_GPP_2020_001.tif mod64m.tif</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Creating output file that is 2969P x 2572L.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Processing MOD17A2H_GPP_2020_001.tif [1/1] : 0Using internal nodata values (e.g. 32767) for image MOD17A2H_GPP_2020_001.tif.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Copying nodata values from source MOD17A2H_GPP_2020_001.tif to destination mod64m.tif.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">...10...20...30...40...50...60...70...80...90...100 - done.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">gdalinfo mod64m.tif</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Driver: GTiff/GeoTIFF</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Files: mod64m.tif</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Size is 2969, 2572</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">Coordinate System is:</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">GEOGCRS["WGS 84",</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">…<br>
Band 1 Block=2969x1 Type=Float64, ColorInterp=Gray</span><u></u><u></u></p>
<p class="MsoNormal" style="margin-bottom:12pt"><span lang="EN-US"> NoData Value=32767</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">I don’t know why nodata is lost for you. Have you already tried to set the output nodata explicitly with -dstnodata 32767 as a workaround?</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"><br>
-Jukka Rahkonen-</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> Chao Li <<a href="mailto:chaoli0394@gmail.com" target="_blank">chaoli0394@gmail.com</a>>
<br>
<b>Lähetetty:</b> maanantai 27. kesäkuuta 2022 10.50<br>
<b>Vastaanottaja:</b> Rahkonen Jukka <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi" target="_blank">jukka.rahkonen@maanmittauslaitos.fi</a>><br>
<b>Aihe:</b> Re: [gdal-dev] gdalwarp Resampling Input Raster Nodata Setting<u></u><u></u></p>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">Dear Ms./Mr. Jukka<u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Thank you for your reply. I try to delete the -srcnodata 32767, but it still doesn't work.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">I have attach a part of raster, in this email.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Thanks for your help<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Best regards<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Rahkonen Jukka <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi" target="_blank">jukka.rahkonen@maanmittauslaitos.fi</a>>
<span style="font-family:"MS Gothic"">于</span>2022<span style="font-family:"MS Gothic"">年</span>6<span style="font-family:"MS Gothic"">月</span>27<span style="font-family:"MS Gothic"">日周一</span> 14:52<span style="font-family:"MS Gothic"">写道:</span><u></u><u></u></p>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt">
<div>
<div>
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">The right syntax is average -srcnodata 32767 but you should 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.</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US">-Jukka Rahkonen-</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> gdal-dev <<a href="mailto:gdal-dev-bounces@lists.osgeo.org" target="_blank">gdal-dev-bounces@lists.osgeo.org</a>>
<b>Puolesta </b>Chao Li<br>
<b>Lähetetty:</b> maanantai 27. kesäkuuta 2022 4.09<br>
<b>Vastaanottaja:</b> <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<b>Aihe:</b> [gdal-dev] gdalwarp Resampling Input Raster Nodata Setting<u></u><u></u></p>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal">Dear GDAL experts,<u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">I have a problem using
<b>gdalwarp</b>.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">I want to reproject a raster and change its resolution by the average method.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">This is the
<b>gdalinfo</b> of the raster<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></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<u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">This is the
<b>gdalwarp</b> commend:<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></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<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">I also tried <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></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<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">However, the 32767 is not set to be nodata, and be averaged in the output raster.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">How can I set this? <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></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?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Since there nothing returns, I really do not know.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Best regards.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<p class="MsoNormal">--
<u></u><u></u></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">------------------------------------------------------------------------------------<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Mike Li<u></u><u></u></p>
<div>
<p class="MsoNormal">Department of Urban and Environmental Engineering<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Graduate School of Engineering<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Kyushu University<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">744 Motooka, Nishi-ku, Fukuoka 819-0395 Japan<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Tel: 090-8304-8953<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">E-mail:
<a href="mailto:chaoli0394@gmail.com" target="_blank">chaoli0394@gmail.com</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">-------------------------------------------------------------------------------------<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"MS Gothic"">李潮(リ チョウ)</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"MS Gothic"">九州大学 大学院 工学府 都市環境システム工学専攻</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"MS Gothic"">都市工学研究室</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">-------------------------------------------------------------------------------------<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><br clear="all">
<u></u><u></u></p>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<p class="MsoNormal">--
<u></u><u></u></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">------------------------------------------------------------------------------------<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Mike Li<u></u><u></u></p>
<div>
<p class="MsoNormal">Department of Urban and Environmental Engineering<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Graduate School of Engineering<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Kyushu University<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">744 Motooka, Nishi-ku, Fukuoka 819-0395 Japan<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Tel: 090-8304-8953<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">E-mail:
<a href="mailto:chaoli0394@gmail.com" target="_blank">chaoli0394@gmail.com</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">-------------------------------------------------------------------------------------<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"MS Gothic"">李潮(リ チョウ)</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"MS Gothic"">九州大学 大学院 工学府 都市環境システム工学専攻</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"MS Gothic"">都市工学研究室</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">-------------------------------------------------------------------------------------<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
<p class="MsoNormal">-- <u></u><u></u></p>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">------------------------------------------------------------------------------------<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Mike Li<u></u><u></u></p>
<div>
<p class="MsoNormal">Department of Urban and Environmental Engineering<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Graduate School of Engineering<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Kyushu University<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">744 Motooka, Nishi-ku, Fukuoka 819-0395 Japan<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Tel: 090-8304-8953<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">E-mail: <a href="mailto:chaoli0394@gmail.com" target="_blank">
chaoli0394@gmail.com</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">-------------------------------------------------------------------------------------<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"MS Gothic"">李潮(リ チョウ)</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"MS Gothic"">九州大学 大学院 工学府 都市環境システム工学専攻</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-family:"MS Gothic"">都市工学研究室</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">-------------------------------------------------------------------------------------<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr">------------------------------------------------------------------------------------</div><div dir="ltr">Mike Li<div>Department of Urban and Environmental Engineering</div><div>Graduate School of Engineering</div><div>Kyushu University</div><div>744 Motooka, Nishi-ku, Fukuoka 819-0395 Japan</div><div>Tel: 090-8304-8953</div><div>E-mail: <a href="mailto:chaoli0394@gmail.com" target="_blank">chaoli0394@gmail.com</a></div><div>-------------------------------------------------------------------------------------</div><div>李潮(リ チョウ)</div><div>九州大学 大学院 工学府 都市環境システム工学専攻</div><div>都市工学研究室</div><div>-------------------------------------------------------------------------------------</div></div></div></div></div></div></div>