[gdal-dev] Setting unit type for a raster band...

Carl Godkin cgodkin at gmail.com
Tue Jan 11 15:37:57 PST 2022


Thanks very much, Even.  Both of those suggestions are very clever.  I
didn't think of that approach.  Now I'm in business.

carl

On Tue, Jan 11, 2022 at 3:35 PM Even Rouault <even.rouault at spatialys.com>
wrote:

>
> Le 12/01/2022 à 00:29, Even Rouault a écrit :
>
>
> Le 12/01/2022 à 00:23, Carl Godkin a écrit :
>
> Hi,
>
> I'm trying to figure out if there's a way to set the unit type for a
> raster band from any of the application programs.  A few seem to copy it
> from input to output bands, but I would like to assign it from the command
> line if possible.
>
> I have searched for SetUnitType() and GDALSetRasterUnitType() calls in the
> GDAL 3.4.0 source and don't see it anywhere but I thought perhaps I'd
> overlooked something.
>
> python -c "from osgeo import gdal; ds = gdal.Open('my.tif',
> gdal.GA_Update); ds.GetRasterBand(1).SetUnitType('my unit')"
>
> Actually, more simple with
> https://gdal.org/programs/gdal_edit.html#cmdoption-units:
>
> gdal_edit.py my.tif -units "my unit"
>
>
>
> Thanks very much,
>
> carl
>
>
>
> _______________________________________________
> gdal-dev mailing listgdal-dev at lists.osgeo.orghttps://lists.osgeo.org/mailman/listinfo/gdal-dev
>
> -- http://www.spatialys.com
> My software is free, but my time generally not.
>
>
> _______________________________________________
> gdal-dev mailing listgdal-dev at lists.osgeo.orghttps://lists.osgeo.org/mailman/listinfo/gdal-dev
>
> -- http://www.spatialys.com
> My software is free, but my time generally not.
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20220111/48ac6d8f/attachment.html>


More information about the gdal-dev mailing list