Hi, 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.
-Jukka Rahkonen- Lähettäjä: gdal-dev <[email protected]> Puolesta Chao Li Lähetetty: maanantai 27. kesäkuuta 2022 4.09 Vastaanottaja: [email protected] Aihe: [gdal-dev] gdalwarp Resampling Input Raster Nodata Setting Dear GDAL experts, I have a problem using gdalwarp. I want to reproject a raster and change its resolution by the average method. This is the gdalinfo of the raster [q70176a@ito-2 ~]$ gdalinfo DP12/11_RawData/02_GGP/Gross_PP_8Days_500m_v6/GPP/MOD17A2H_GPP_2016_001.tif Driver: GTiff/GeoTIFF Files: DP12/11_RawData/02_GGP/Gross_PP_8Days_500m_v6/GPP/MOD17A2H_GPP_2016_001.tif Size is 86400, 31200 Coordinate System is: PROJCRS["unknown", BASEGEOGCRS["unknown", DATUM["unknown", ELLIPSOID["unknown",6371007.181,0, LENGTHUNIT["metre",1, ID["EPSG",9001]]]], PRIMEM["Greenwich",0, ANGLEUNIT["degree",0.0174532925199433, ID["EPSG",9122]]]], CONVERSION["Sinusoidal", METHOD["Sinusoidal"], PARAMETER["Longitude of natural origin",0, ANGLEUNIT["degree",0.0174532925199433], ID["EPSG",8802]], PARAMETER["False easting",0, LENGTHUNIT["metre",1], ID["EPSG",8806]], PARAMETER["False northing",0, LENGTHUNIT["metre",1], ID["EPSG",8807]]], CS[Cartesian,2], AXIS["easting",east, ORDER[1], LENGTHUNIT["metre",1, ID["EPSG",9001]]], AXIS["northing",north, ORDER[2], LENGTHUNIT["metre",1, ID["EPSG",9001]]]] Data axis to CRS axis mapping: 1,2 Origin = (-20015109.353999998420477,7783653.637667000293732) Pixel Size = (463.312716527771215,-463.312716527787586) Metadata: AREA_OR_POINT=Area Image Structure Metadata: INTERLEAVE=BAND Corner Coordinates: Upper Left (-20015109.354, 7783653.638) (166d17' 5.25"W, 70d 0' 0.00"N) Lower Left (-20015109.354,-6671703.118) ( 0d 0' 0.00"E, 60d 0' 0.00"S) Upper Right (20015109.354, 7783653.638) (166d17' 5.25"E, 70d 0' 0.00"N) Lower Right (20015109.354,-6671703.118) ( 0d 0' 0.00"W, 60d 0' 0.00"S) Center ( -0.000, 555975.260) ( 0d 0' 0.00"W, 5d 0' 0.00"N) Band 1 Block=86400x1 Type=Int16, ColorInterp=Gray NoData Value=32767 This is the gdalwarp commend: [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 I also tried [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 However, the 32767 is not set to be nodata, and be averaged in the output raster. How can I set this? 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? Since there nothing returns, I really do not know. Best regards. -- ------------------------------------------------------------------------------------ Mike Li Department of Urban and Environmental Engineering Graduate School of Engineering Kyushu University 744 Motooka, Nishi-ku, Fukuoka 819-0395 Japan Tel: 090-8304-8953 E-mail: [email protected]<mailto:[email protected]> ------------------------------------------------------------------------------------- 李潮(リ チョウ) 九州大学 大学院 工学府 都市環境システム工学専攻 都市工学研究室 -------------------------------------------------------------------------------------
_______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev
