Thanks Even, I'll have a look at your suggestions.
BTW for MapWindow we don't use the GDAL C# API. >From our C#/Winforms we 'talk' to our MapWinGIS wich is a C++ ActiveX control. MapWinGIS does the communication with GDAL. This is much faster and more stable than using C# bindings. Thanks, Paul *Paul Meems * Release manager, configuration manager and forum moderator of MapWindow GIS. www.mapwindow.org Owner of MapWindow.nl - Support for Dutch speaking users. www.mapwindow.nl * * 2013/1/2 Even Rouault <[email protected]> > Selon Paul Meems <[email protected]>: > > > 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? > > My message was that the output format of gdalinfo is primarly for humans, > not to > be fed into other software. Well, this is my vision. You can do whatever > you > want of course. (Hint: QGIS uses the C API to feed its Open raster dialog) > > > Perhaps I should not handle this in my C#/WinForms but do this in our C++ > > core. > > You can probably use the GDAL C# API. This is basically just iterating > over the > drivers and querying the relevant metadata keys. Should be pretty similar > to the > C++ code. > > > 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 ;) > > By hard-coded strings, do you mean GDAL_DMD_EXTENSION and such strings ? > Well, > they are part of the GDAL API, so they shouldn't change in the foreseable > future. They are also available in SWIG bindings (something like > Gdal.DMD_EXTENSION but I'm not sure, as I don't use the C# bindings myself) > > > > > 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. > > Yes, I understood that. For OGR drivers, for now, you'll have to hardcode > the > information (or put it into a config file with the relevant information). > For > GDAL drivers, you can use the API to dynamically query the information. >
_______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
