[gdal-dev] gdal_translate file naming for sds and HDF4 files

Jonathan Greenberg jgrn at illinois.edu
Fri May 31 09:04:57 PDT 2013


Thanks -- I did notice it was an earlier version (switching to the latest
OSGeo4W), I apologize for not checking the latest, but as Etienne
confirmed, the bug seems to be there in the latest as well.  The HDF files
from various sources are so odd when it comes to naming layers, that this
SDS argument is really helpful (if it would name the files correctly).

Speaking of -sds --> perhaps I can request that gdal_translate allow for a
layer # flag rather than the full layer name for subdataset files?  Is this
relatively easy to implement (since gdalinfo seems to already have the
capability)?

--j


On Thu, May 30, 2013 at 3:50 PM, Etienne Tourigny
<etourigny.dev at gmail.com>wrote:

>
>
> On Thu, May 30, 2013 at 4:46 PM, Jukka Rahkonen <jukka.rahkonen at mmmtike.fi
> > wrote:
>
>> Jonathan Greenberg <jgrn <at> illinois.edu> writes:
>>
>> >
>> > Folks:
>> > I'm using a Windows install of GDAL 1.7.0 (FWTools) -- when I run:
>> >
>> > gdal_translate -sds -of "GTiff" [some.hdf] "myoutput"
>> > The output filenames do not have the .tif extension.  If I set the
>> output
>> file to "myoutput.tif", it appends the "layer numbers" to the end of the
>> file, e.g. myoutput.tif1.  Any tricks to getting the naming working
>> properly
>> (myoutput1.tif would be what I'd expect)?
>>
>>  Hi,
>>
>> First, acquire more fresh GDAL, current version is 1.10. Use OSGeo4W or
>> download Windows binaries from http://gisinternals.com/sdk/
>>
>
>  actually the same thing happens with gdal-1.10. I will prepare a bug
> report and fix.
>
>
>>
>>
>> Then, perhaps you should use gdalinfo first for seeing the exact names of
>> layers as GDAL understands them and use such a layer name as input instead
>> of [some.hdf]. Read usage examples from
>> http://www.gdal.org/frmt_hdf4.html
>
>
>  the idea of using the -sds argument is to generate an output file for
> each subdataset, without having to search for subdataset names
>
>
>>
>>
>> -Jukka Rahkonen-
>>
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
>
>


-- 
Jonathan A. Greenberg, PhD
Assistant Professor
Global Environmental Analysis and Remote Sensing (GEARS) Laboratory
Department of Geography and Geographic Information Science
University of Illinois at Urbana-Champaign
607 South Mathews Avenue, MC 150
Urbana, IL 61801
Phone: 217-300-1924
http://www.geog.illinois.edu/~jgrn/
AIM: jgrn307, MSN: jgrn307 at hotmail.com, Gchat: jgrn307, Skype: jgrn3007
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20130531/b5eb3bd0/attachment-0001.html>


More information about the gdal-dev mailing list