[Gdal-dev] Re: Warping MODIS

Jose Luis Gomez Dans josegomez at gmx.net
Mon Feb 12 17:20:53 EST 2007


Frank and Markus,
Sorry for not replying on-thread. It appears that gmane.org is pointing to 
<gdal-dev at remotesensing.org>, rather than to <gdal-dev at lists.maptools.org>, so my mails kept bouncing back


> Jose Luis Gomez Dans wrote:
> > 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?

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

As Markus pointed out, I followed pretty much his script. My first attempt is to
 reproject, subset and change format (phew!) using a single gdalwarp (using gdal
1.4.0 on Linux/i386 and Win2k):

gdalwarp -of GTiff -tr 1000. 1000. -rn -s_srs "+proj=latlong +ellps=sphere"
-t_srs "EPSG:23030"\
'HDF4_EOS:EOS_GRID:XXXXX' EVI.tif

This fails with a projection-related error:
ERROR 1: geocentric transformation missing z or ellps
ERROR 1: GDALSuggestedWarpOutput() failed because the passed
transformer failed.

I think I am missing something in the projection definition. Somewhere :)

Now, I can go ahead and convert to Long/Lat WGS84, and then to my chosen
projection (UTM30N/ED50, EPSG 23030), pretty much as per Markus' script:
1.- gdalwarp -of GTiff  -rn -t_srs "+proj=latlong +ellps=sphere" \
 'HDF4_EOS:XXXX' EVI.tif
2.- gdalwarp -rn -of GTiff -tr 1000 1000 -s_srs "EPSG:4326" -t_srs "EPSG:23030"
EVI.tif EVI.utm.tif


Shouldn't I just need to use my first attempt by setting the right source
projection (-s_srs) and warping from there on?

> > Further, is the gdalwarper API available for python? The docs say it is
> Currently the only aspect of the warper that is exposed in Python is the
> AutoCreateWarpedVRT() function.  It is also possible to manually construct
> a warped VRT (as XML) in Python and use that as input to CreateCopy() to
> cause a warp to occur.  But there is no tight integration between the
> warp api and python.

Hmmmm... I need to understand how VRTs work first :) However, it looks feasible

Again, many thanks for gdal, it is being really useful in our work!
Jose

-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer



More information about the Gdal-dev mailing list