[gdal-dev] gdalinfo and ogrinfo file formats

Paul Meems bontepaarden at gmail.com
Wed Jan 2 06:08:02 PST 2013


Hi Even,

I'm not sure why I shouldn't use --format. If I can't use it why is it
provided?
Can I use --formats?
Perhaps I should not handle this in my C#/WinForms but do this in our C++
core.
I think we can make a method that would return what I need based on
gcore/gdal_misc.cpp but that would rely on hard-coded strings.
I don't like that either ;)

For the formats for ogr2ogr I understand I need to use a workaround so I
could do that for the gdal formats as well.
The whole idea is/was that when we upgrade to a newer version of GDAL/ORG
or recompile it with some different settings our tools would automagically
use the correct file formats.

This needs some more pondering from our side ;)

Thanks,

Paul


2013/1/2 Even Rouault <even.rouault at mines-paris.org>

> You don't parse the output of gdalinfo --format, do you ? Please don't do
> this :
> this is really fragile. Imagine what will happen if the output format of
> the
> utility change in some later version ? (We wouldn't do that just for fun,
> but
> relying on that is fragile). Rather look at the source code of gdalinfo (or
> actually at GDALGeneralCmdLineProcessor() in gcore/gdal_misc.cpp to C
> which API
> calls are involved.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20130102/76bb4b90/attachment.html>


More information about the gdal-dev mailing list