[Gdal-dev] Warping MODIS

guillaume huby guillaume.huby.lists at gmail.com
Mon Feb 19 12:46:42 EST 2007


Frank Warmerdam wrote:

Jose Luis Gomez Dans wrote:
>
> Hi!
>
> I have read a couple of postings regarding MODIS subsetting and warping. I
>
> have been using HEGTools up to now, but I find that having just GDAL in my
>
> processing chain makes life easier. So far, i understand that I need to
> warp
> a subdataset off the HDFEOS file to change the ellps parameter so that the
>
> subdataset is available in Lat/Long WGS84. This seems to work, and I can
> the
> reproject into UTMXX/DatumXYZ again. This requires a gdalwarp, a
> gdal_translate and a further gdalwarp. is there a more direct route?
>
>
> Jose,
>
> You would need to be more specific about what exact steps you are doing.
> Off hand I would think you could do things in a single gdalwarp from
> a subdataset to an output file in UTM using the -s_srs switch to override
> the interpretation of the input coordinate system if required.
>


Frank,

I am experiencing the same troubles (using FWTools 1.2.0).


My MODIS image is (downloaded from the EOS data gateway):
################## Code
>gdalinfo HDF4_EOS:EOS_GRID:"SomeData.hdf":Product:Band
Driver: HDF4Image/HDF4 Dataset
Size is 2400, 2400
Coordinate System is:
PROJCS["unnamed",
    GEOGCS["Unknown datum based upon the custom spheroid",
        DATUM["Not specified (based on custom spheroid)",
            SPHEROID["Custom spheroid",6371007.181,0]],
        PRIMEM["Greenwich",0],
        UNIT["degree",0.0174532925199433]],
    PROJECTION["Sinusoidal"],
    PARAMETER["longitude_of_center",0],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["Meter",1]]
Origin = (0.000000000000000,5559752.598333000200000)
Pixel Size = (463.312716527916680,-463.312716527500130)
Metadata:
...
################## End code
(btw it is supposed to be a HDF5 and not a HDF4, but this doesn't seem to be
the problem)

I tried (EPSG:27572 is NTF (Paris) / Lambert zone II):
################## Code
gdalwarp -t_srs EPSG:27572 HDF4_EOS:EOS_GRID:"SomeData.hdf":Product:Band
SomeData_out.tif
gdalwarp -s_srs "+proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=
6371007.181 +units=m  no_defs <>" -t_srs EPSG:27572 HDF4_EOS:EOS_GRID:"
SomeData.hdf":Product:Band SomeData_out.tif
################## End code

These commands gave me a shift in the Y axis (around 21 km).

Using the trick of Markus (
http://mpa.itc.it/markus/useful/modis_hdf2erdas_ll_wgs84.sh) is a solution,
but in 3 commands like Jose described.

Do you know a shorter way to achieve this ?

Thank you in advance for your reply.

Regards,
Guillaume.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20070219/a51d68f8/attachment.html


More information about the Gdal-dev mailing list