[gdal-dev] MODIS re-projection issues (gdalwarp -tps)

Giuseppe Amatulli giuseppe.amatulli at gmail.com
Wed Apr 16 07:27:51 PDT 2014


Hi,
I'm encountering a re-projection issues with several MODIS files stored as
hdf and having GCP attached when convert to tif.
In particular i'm working with files stored at
ftp://ladsweb.nascom.nasa.gov/allData/6/MYD04_3K/
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 )

You can directly download and process the files with the following lines
These files have already lat-long assignment, indeed the GCP appear as
lat-long and not as sinusoidal.

# file with correct re-projection

wget
ftp://ladsweb.nascom.nasa.gov/allData/6/MYD04_3K/2002/185/MYD04_3K.A2002185.0255.006.2013356131116.hdf

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
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

# file with correct re-projection

wget
ftp://ladsweb.nascom.nasa.gov/allData/6/MYD04_3K/2002/185/MYD04_3K.A2002185.0410.006.2013356131547.hdf
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
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

# file with not correct re-projection

wget
ftp://ladsweb.nascom.nasa.gov/allData/6/MYD04_3K/2002/185/MYD04_3K.A2002185.0120.006.2013356130920.hdf
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
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

openev *_Aerosol_Optical_Depth_tw.tif
or
qgis *_Aerosol_Optical_Depth_tw.tif

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.

gdalinfo
MYD04_3K.A2002185.0120.006.2013356130920_Aerosol_Optical_Depth.tif  | grep
COORDINATE
  EASTBOUNDINGCOORDINATE=-159.569928338522         # this correspond to
the  left part of the image
  NORTHBOUNDINGCOORDINATE=82.1907920741757
  SOUTHBOUNDINGCOORDINATE=58.0763940337017
  WESTBOUNDINGCOORDINATE=115.314065119164         # this correspond to the
right part of the image


Is there is a way to solve this problem?
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.

or there are alternative sw which can be used (MRT and MRTswath are not
useful for this kind of data )?
Thanks in advance
Best

-- 
Giuseppe Amatulli, Ph.D.

Center for Earth Observation
ESC Room 119A
Yale University
P.O. Box 208109
New Haven, CT, 06520-8109
Teaching: spatial-ecology.net
Work:  http://sbsc.yale.edu/giuseppe-amatulli
<http://www.spatial-ecology.net>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20140416/9d729bbd/attachment-0001.html>


More information about the gdal-dev mailing list