[gdal-dev] help for including category names
Marcel Derrien
marcel.derrien at meteo.fr
Wed Apr 6 11:14:46 EDT 2011
Even,
Many thanks for your clear answer that helps the understanding, I will
directly associate an .aux.xml instead of using the VRT file for
managing category names.
I agree that avoiding the .aux.xml would be more convenient.
Best regards,
---
Marcel
Even Rouault a écrit :
> Marcel,
>
> I guess that category name is a rarely used features by GDAL users and it
> wasn't actually supported by the custom CreateCopy() implementation of the
> GTiff driver.
>
> I've just pushed into svn trunk (r22120) a fix so that
> GTiffDataset::CreateCopy() copies the category names from the source dataset.
> But note that the geotiff/tiff format makes no provision for category names, so
> the effect of this is to copy the data in a .aux.xml file next to the geotiff
> file. The .aux.xml file is a GDAL specific format.
>
> In the meantime, you can generate the .aux.xml file by yourself. For example :
>
> <PAMDataset>
> <PAMRasterBand band="1">
> <CategoryNames>
> <Category>Not processed</Category>
> <Category>Cloud-free land</Category>
> </CategoryNames>
> </PAMRasterBand>
> </PAMDataset>
>
> GDAL 1.8.0 will be able to fetch the category names from it.
>
> Another possibility to avoid the .aux.xml file would be to extend the
> capabilities of the GDAL's specific TIFFTAG_GDAL_METADATA. Currently it only
> holds dataset and rasterband level metadata, but not category names. But such
> a change would be a bit more involved. Another issue to take into account is
> that maximum size of the content that can be written in the tag is limited to
> 32000 bytes.
>
> Best regards,
>
> Even
>
>
> Le mardi 05 avril 2011 16:05:04, Marcel Derrien a écrit :
>
>> Hello,
>> I am new with gdal, and it is my first post here.
>> I have a gdal 1.8.0 installed on a cenOS Linux x86_64 ,with libtiff
>> 3.9.4 and libgeotiff 1.3.0.
>> I try the translation of a raster dataset to geotiff through a
>> VRTRawRasterBand described in a VRT file using gdal_translate.
>> gdal_translate test.vrt test.tif
>> The VRT file includes a category list description that I would like to
>> get in the resulting geotiff.
>> The geotiff produced is correct but the only thing that is missing is
>> the category names that I can't see with gdalinfo.
>> It seems as if the category list was not managed, as the resulting file
>> size is the same with and without the categorynames section in the VRT.
>> I suspect my gdal installation or maybe I have a bad understanding of
>> the way to manage this option.
>> Could somebody help to find an explanation ?
>>
>> gdal-config --version
>> 1.8.0
>> gdal-config --dep-libs
>> -lsqlite3 -L/usr/lib64/lib -lexpat -lgif -ljpeg
>> -L/export/util/libgeotiff-1.3.0/lib -lgeotiff
>> -L/export/util/tiff-3.9.4/lib -ltiff -lpng -L/export/util/netcdf-3.6.2
>> -L/export/util/netcdf-3.6.2/lib -lnetcdf -lz -lpthread -lm -lrt -ldl
>> -L/usr/kerberos/lib64 -lcurl -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err
>> -lresolv -ldl -lidn -lssl -lcrypto -lz
>>
>>
>> gdalinfo t.tif
>>
>> Driver: GTiff/GeoTIFF
>> Files: t.tif
>> Size is 3712, 3712
>> Coordinate System is:
>> PROJCS["Geostationary_Satellite",
>> GEOGCS["GCS_unnamed ellipse",
>> DATUM["D_unknown",
>> SPHEROID["Unknown",6378169,295.4880658970008]],
>> PRIMEM["Greenwich",0],
>> UNIT["Degree",0.017453292519943295]],
>> PROJECTION["Geostationary_Satellite"],
>> PARAMETER["central_meridian",0],
>> PARAMETER["satellite_height",35785831],
>> PARAMETER["false_easting",0],
>> PARAMETER["false_northing",0],
>> UNIT["Meter",1]]
>> Origin = (-5570248.832537000067532,5570248.832537000067532)
>> Pixel Size = (3000.403357000000142,-3000.403357000000142)
>> Metadata:
>> AREA_OR_POINT=Area
>> Image Structure Metadata:
>> INTERLEAVE=BAND
>> Corner Coordinates:
>> Upper Left (-5570248.833, 5570248.833)
>> Lower Left (-5570248.833,-5567248.429)
>> Upper Right ( 5567248.429, 5570248.833)
>> Lower Right ( 5567248.429,-5567248.429)
>> Center ( -1500.202, 1500.202)
>> Band 1 Block=3712x2 Type=Byte, ColorInterp=Palette
>> Color Table (RGB with 256 entries)
>> 0: 100,100,100,255
>> ....
>>
>> Here is the VRT file content:
>> <VRTDataset rasterXSize="3712" rasterYSize="3712">
>> <GeoTransform>-5570248.832537, 3000.403357, 0.000000,
>> 5570248.832537, 0.000000, -3000.403357</GeoTransform>
>>
>> <SRS>PROJCS["Geostationary_Satellite",GEOGCS["GCS_unnamed
>> ellipse",DATUM["D_unknown",SPHEROID["Unknown",6378
>> 169,295.4880658970008]],PRIMEM["Greenwich",0],UNIT["degree&q
>> uot;,0.0174532925199433]],PROJECTION["Geostationary_Satellite"],P
>> ARAMETER["central_meridian",0],PARAMETER["satellite_height&q
>> uot;,35785831],PARAMETER["false_easting",0],PARAMETER["false
>> _northing",0],UNIT["metre",1]]</SRS> <Metadata>
>> <MDI key="AREA_OR_POINT">Area</MDI>
>> </Metadata>
>> <Description>Cloud Type Layer</Description>
>> <VRTRasterBand dataType="Byte" band="1" subClass="VRTRawRasterBand">
>> <ColorInterp>Palette</ColorInterp>
>> <ColorTable>
>> <Entry c1="100" c2="100" c3="100"/>
>> <Entry ...
>> ...
>> </ColorTable>
>> <CategoryNames>
>> <Category>Not processed</Category>
>> <Category>Cloud-free land</Category>
>> ...
>> </CategoryNames>
>> <SourceFilename relativetoVRT="1">t.fis</SourceFilename>
>> <ImageOffset>7424</ImageOffset>
>> <PixelOffset>1</PixelOffset>
>> <LineOffset>3712</LineOffset>
>> <ByteOrder>LSB</ByteOrder>
>> </VRTRasterBand>
>> </VRTDataset>
>>
>>
>>
>> Thanks in advance,
>> ---
>> Marcel Derrien
>>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: marcel_derrien.vcf
Type: text/x-vcard
Size: 375 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/gdal-dev/attachments/20110406/433c457b/marcel_derrien.vcf
More information about the gdal-dev
mailing list