[gdal-dev] Tag for units in GeoTIFF

Even Rouault even.rouault at spatialys.com
Thu Oct 26 03:27:24 PDT 2023


Javier,

Le 26/10/2023 à 11:59, Javier Jimenez Shaw via gdal-dev a écrit :
> Hi
>
> Using a GeoTIFF with a single band and float values can be very useful 
> to show any distribution over the terrain. One typical example is DSM 
> (digital surface model), where the value is the elevation on every point.
>
> Is there any standard (or accepted) metadata to say the units of those 
> values?

API wise in GDAL, you should use the GDALRasterBand::SetUnitType() to 
set the unit

For TIFF, this will be encoded in the GDAL_METADATA TIFF tag like the 
following:

<GDALMetadata>
   <Item name="UNITTYPE" sample="0" role="unittype">foo</Item>
</GDALMetadata>

Regarding the value itself, it is mostly unspecified by GDAL. It could 
be a good practice to suggest to use strings recognized by the "udunits" 
package (when possible), like done in the netCDF CF conventions 
(http://cfconventions.org/Data/cf-conventions/cf-conventions-1.10/cf-conventions.html#units)

Even

>
> In the typical case of DSM it is usually "meter" or "foot". But it can 
> be something else, like "people/km2" for population, or "mm" for rain 
> precipitation, or "kg/ha" for agricultural yield.
>
> Thanks
> .___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20231026/8c4b01c3/attachment.htm>


More information about the gdal-dev mailing list