[gdal-dev] Metadata keys in upper or lower case ?

Even Rouault even.rouault at spatialys.com
Mon Jan 30 08:33:56 PST 2023


Louis-Philippe,

there's no recommendation. Each format or community within a format may 
have different practices.

Some formats may accept some odd characters (but definitely not '=', as 
key/value pairs are stored as "key=value" strings internally), but 
keeping to alphanumeric + underscore is the best way to be universally 
accepted.

That said you'd better not use several metadata keys that only defer by 
case, otherwise you're going to confuse a lot of places in GDAL as 
comparisons are done in a case insensitive way. I mean: "foo" and "BAR" 
are fine within the same metadata. But not "foo", "Foo" and "FOO".

Even

Le 30/01/2023 à 16:54, Rousseau Lambert,Louis-Philippe (ECCC) a écrit :
>
> Hi everyone !
>
> I would like to know if there is a rule or a best practice for a 
> raster file's metadata key to be written in upper or lower case ?
>
>  I read https://gdal.org/user/raster_data_model.html#metadata and saw 
> that "/The names are required to be well behaved tokens (no spaces, or 
> odd characters//)./" but I didn't read anything about upper vs lower 
> cases. While I see examples of both (upper and lower case) in 
> different valid files, I would like to know if a documented 
> recommendation exists ?
>
> Thanks
>
> LP
>
>
> _______________________________________________
> 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/20230130/539dc1ea/attachment.htm>


More information about the gdal-dev mailing list