<div dir="ltr"><div><div><div><br></div>Hi,<br></div>I'm encountering a re-projection issues with several MODIS files stored as hdf and having GCP attached when convert to tif. <br></div>In particular i'm working with files stored at <br>
<div><div><div><a href="ftp://ladsweb.nascom.nasa.gov/allData/6/MYD04_3K/">ftp://ladsweb.nascom.nasa.gov/allData/6/MYD04_3K/</a><br></div><div>The re-projection issues appear only in files which store GCP in the extreme of east and west coordinates (e.g -176 , +173 ; -178 , +179 )<br>
</div><div><br clear="all"></div><div>You can directly download and process the files with the following lines<br></div><div>These files have already lat-long assignment, indeed the GCP appear as lat-long and not as sinusoidal. <br>
</div><div><br># file with correct re-projection <br><br>wget <a href="ftp://ladsweb.nascom.nasa.gov/allData/6/MYD04_3K/2002/185/MYD04_3K.A2002185.0255.006.2013356131116.hdf">ftp://ladsweb.nascom.nasa.gov/allData/6/MYD04_3K/2002/185/MYD04_3K.A2002185.0255.006.2013356131116.hdf</a> <br>
gdal_translate -b 2 -a_srs EPSG:4326 HDF4_EOS:EOS_SWATH:"MYD04_3K.A2002185.0255.006.2013356131116.hdf":mod04:Corrected_Optical_Depth_Land MYD04_3K.A2002185.0255.006.2013356131116_Aerosol_Optical_Depth.tif <br>
gdalwarp -co COMPRESS=LZW -co ZLEVEL=9 -srcnodata -9999 -dstnodata -9999 -of GTIFF -tps -t_srs EPSG:4326 -overwrite MYD04_3K.A2002185.0255.006.2013356131116_Aerosol_Optical_Depth.tif MYD04_3K.A2002185.0255.006.2013356131116_Aerosol_Optical_Depth_tw.tif <br>
<br># file with correct re-projection <br><br>wget <a href="ftp://ladsweb.nascom.nasa.gov/allData/6/MYD04_3K/2002/185/MYD04_3K.A2002185.0410.006.2013356131547.hdf">ftp://ladsweb.nascom.nasa.gov/allData/6/MYD04_3K/2002/185/MYD04_3K.A2002185.0410.006.2013356131547.hdf</a><br>
gdal_translate -b 2 -a_srs EPSG:4326 HDF4_EOS:EOS_SWATH:"MYD04_3K.A2002185.0410.006.2013356131547.hdf":mod04:Corrected_Optical_Depth_Land MYD04_3K.A2002185.0410.006.2013356131547_Aerosol_Optical_Depth.tif <br>
gdalwarp -co COMPRESS=LZW -co ZLEVEL=9 -srcnodata -9999 -dstnodata -9999 -of GTIFF -tps -t_srs EPSG:4326 -overwrite MYD04_3K.A2002185.0410.006.2013356131547_Aerosol_Optical_Depth.tif MYD04_3K.A2002185.0410.006.2013356131547_Aerosol_Optical_Depth_tw.tif <br>
<br># file with not correct re-projection <br><br>wget <a href="ftp://ladsweb.nascom.nasa.gov/allData/6/MYD04_3K/2002/185/MYD04_3K.A2002185.0120.006.2013356130920.hdf">ftp://ladsweb.nascom.nasa.gov/allData/6/MYD04_3K/2002/185/MYD04_3K.A2002185.0120.006.2013356130920.hdf</a><br>
gdal_translate -b 2 -a_srs EPSG:4326 HDF4_EOS:EOS_SWATH:"MYD04_3K.A2002185.0120.006.2013356130920.hdf":mod04:Corrected_Optical_Depth_Land MYD04_3K.A2002185.0120.006.2013356130920_Aerosol_Optical_Depth.tif <br>
gdalwarp -co COMPRESS=LZW -co ZLEVEL=9 -srcnodata -9999 -dstnodata -9999 -of GTIFF -tps -t_srs EPSG:4326 -overwrite MYD04_3K.A2002185.0120.006.2013356130920_Aerosol_Optical_Depth.tif MYD04_3K.A2002185.0120.006.2013356130920_Aerosol_Optical_Depth_tw.tif <br>
<br>openev *_Aerosol_Optical_Depth_tw.tif <br></div><div>or <br></div><div>qgis *_Aerosol_Optical_Depth_tw.tif <br><br></div><div>The problem appear because the file MYD04_3K.A2002185.0120.006.2013356130920_Aerosol_Optical_Depth.tif is stretch in the longitude direction to allows the -long to go to west and +long to go to the est.<br>
<br>gdalinfo MYD04_3K.A2002185.0120.006.2013356130920_Aerosol_Optical_Depth.tif | grep COORDINATE <br> EASTBOUNDINGCOORDINATE=-159.569928338522 # this correspond to the left part of the image<br> NORTHBOUNDINGCOORDINATE=82.1907920741757<br>
SOUTHBOUNDINGCOORDINATE=58.0763940337017<br> WESTBOUNDINGCOORDINATE=115.314065119164 # this correspond to the right part of the image<br><br><br></div><div>Is there is a way to solve this problem?<br></div><div>
I think that, cut the image considering the -180 +180 transition would solve the problem but has to be cut at GCP level and i do not have any clue how to do it.<br><br></div><div>or there are alternative sw which can be used (MRT and MRTswath are not useful for this kind of data )?<br>
</div><div>Thanks in advance <br></div><div>Best<br></div><div><br>-- <br><div dir="ltr">Giuseppe Amatulli, Ph.D.
<br><br>Center for Earth Observation <br>ESC Room 119A <br>Yale University <span> </span><br>P.O. Box 208109 <span> </span><br>
New Haven, CT, 06520-8109 <br><div>
Teaching: <a href="http://spatial-ecology.net" target="_blank">spatial-ecology.net</a>
</div>
Work: <a href="http://sbsc.yale.edu/giuseppe-amatulli" target="_blank">http://sbsc.yale.edu/giuseppe-amatulli</a> <br><a href="http://www.spatial-ecology.net" target="_blank"></a></div>
</div></div></div></div>