[gdal-dev] ogrinfo behaviour with -al and -json options

Even Rouault even.rouault at spatialys.com
Wed Jul 3 15:02:51 PDT 2024


Hi,

Le 03/07/2024 à 07:25, Andrea Giudiceandrea via gdal-dev a écrit :
> Hi all,
> IIUC, the documentation states that with the -al option, ogrinfo 
> should output the info of all layers in a container (e.g. a GPKG 
> file). Anyway, when a layer name is provided in the command line 
> string alongside the -al option, than it looks like the -al option is 
> overridden and not taken in consideration.
>
> Is this the expected behaviour?
Problably more in unspecified territory than really intended/designed. 
-al and giving a layer name should probably be mutually exclusive. Not 
clear if at that point of history it would be worth changing that to 
error out and breaking existing user workflows...
>
> The same behaviour occurs with the -json option, where the 
> documentation states than in such case the -al option is also implicit.

-json is a bit specific in the way that you mostly use to feed other 
code and so you don't necessarily need to have as many different level 
of details as for for the text / human friendly output.

>
> If those are the correct and expected behaviour, maybe it would be 
> useful to clarify it in the documentation.

It would probably wouldn't hurt mentioning in the documentation that if 
both -al and layer name(s) are specified, the later will override the 
former (but that users shouldn't rely on that, in case we change our 
mind at some later point)

Even

-- 
http://www.spatialys.com
My software is free, but my time generally not.



More information about the gdal-dev mailing list