[Gdal-dev] projection lost when translating HDF to GTiff
Jon Saints
saintsjd at yahoo.com
Wed Jul 13 00:09:20 EDT 2005
You need to use gdal_warp instead of gdaltranslate. I
had the same problem for a while until the list helped
me.
To convert an hdf subset to geotiff with projection
information I use the command:
gdalwarp HDF_SUBSET_NAME_HERE OUT_FILE_NAME.tif
for example I run:
gdalinfo MYD09A1.A2004313.h21v10.004.2004324183345.hdf
and see:
Subdatasets:
SUBDATASET_1_NAME=HDF4_SDS:UNKNOWN:"MYD09A1.A2004313.h21v10.004.2004324183345.
hdf":0
I use this information to export the first hdf subset
to geotiff by the command:
gdalwarp
HDF4_SDS:UNKNOWN:"MYD09A1.A2004313.h21v10.004.2004324183345.
hdf":0 outfile_band1.tiff
I hope this helps
Jon
--- Brent Fraser <bfraser at geoanalytic.com> wrote:
> Thom,
>
> "+south" should do it. Not too sure about "-19"
> as a zone number... So
> try:
>
> -t_srs "+proj=utm +zone=19 +south +datum=WGS84"
>
> If the orginal data is defined by GCPs and not a
> spatial reference system
> definition type (EPSG, proj, ...) gdalwarp/gdalinfo
> can translate into EPSG,
> then you will have to specifiy -t_srs option.
>
> Brent
>
>
> ----- Original Message -----
> From: "Thom DeCarlo" <t.r.decarlo at larc.nasa.gov>
> To: "'Brent Fraser'" <bfraser at geoanalytic.com>;
> <gdal-dev at xserve.flids.com>
> Sent: Tuesday, July 12, 2005 2:50 PM
> Subject: RE: [Gdal-dev] projection lost when
> translating HDF to GTiff
>
>
> Hi Brent,
> Yes, it does show a coord sys, but it is defined by
> GCPs. I found an email
> in the archive that says I need to use gdalwarp to
> convert it into a
> geo-transform matrix-based system. I've tried doing
> that, but for some
> reason the output is not ending up in UTM. Instead,
> Imagine says it is
> Transverse Mercator. I've tried setting the target
> coord sys manually
> (-t_srs "+proj=utm +zone=-19 +datum=wgs84"), but I
> cannot figure out how to
> tell it that it is in the southern hemisphere. And I
> really don't think I
> should have to give it the target coord sys. The
> data is starting in UTM so
> it should stay in UTM.
>
> --
> Thom DeCarlo
>
-------------------------------------------------------
> Is it a bad sign if you spend the day wondering
> why there are no laws against what you do for a
> living?
> - Dilbert
>
> > -----Original Message-----
> > From: Brent Fraser
> > Sent: Tuesday, July 12, 2005 3:42 PM
> > To: Thom DeCarlo; gdal-dev at xserve.flids.com
> > Subject: Re: [Gdal-dev] projection lost when
> translating HDF to GTiff
> >
> > Thom,
> >
> > Do you get a coord sys defined when you do a
> "gdalinfo" on the hdf file?
> >
> > Brent
> >
> >
> > ----- Original Message -----
> > From: "Thom DeCarlo" <t.r.decarlo at larc.nasa.gov>
> > To: <gdal-dev at xserve.flids.com>
> > Sent: Tuesday, July 12, 2005 11:52 AM
> > Subject: [Gdal-dev] projection lost when
> translating HDF to GTiff
> >
> >
> > Hi,
> > I gave up on compiling the HDF4 code myself and
> found that the binary
> > bundle
> > will work with a couple of tweaks.
> >
> > Anyway, I've got a bunch of ASTER DEM files that I
> need to convert to
> > geotiff and I'm losing the geographic projection
> info when I do the simple
> > "gdal_translate -of GTiff input.hdf output.tif"
> >
> > I looked at the online docs and didn't see
> anything special needed to do
> > this translate. Can someone tell me what I'm
> missing?
> >
> > Thanks,
> > Thom
> > --
> > Thom DeCarlo
> >
>
-------------------------------------------------------
> > It is ok to celebrate diversity...
> > As long as you don't point out that people are
> different.
> > - Colin Quinn
> >
> >
> > _______________________________________________
> > Gdal-dev mailing list
> > Gdal-dev at xserve.flids.com
> > http://xserve.flids.com/mailman/listinfo/gdal-dev
>
>
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at xserve.flids.com
> http://xserve.flids.com/mailman/listinfo/gdal-dev
>
More information about the Gdal-dev
mailing list