[gdal-dev] RFC 44: JSON/XML output for ogrinfo/gdalinfo
Dan Little
danlittle at yahoo.com
Tue Nov 19 11:43:42 PST 2013
I'm not sure as to the purposed utility of the gdalinfo -vrt conversion approach. It may very well be valid, I spend most of my time with vector data and can't take a position one way or the other. Even so, I think having a script friendly output format for ogrinfo is very useful. When Howard and I chatted about it, I started getting visions of a massive metadata site generating itself with not more than a couple of command line scripts. These may be delusions of grandeur but this modification would overcome a first-line obstacle to making it a reality.
I too have some concern about maintaining three different formats. I was actually inclined to generate an intermediate format that would then go to XML or JSON but the XML version came together rather cleanly in a few hours so I didn't go down that path. The proof of concept came together far enough that we thought it prudent to get the ideas formally put into an RFC.
Multiple formats comes with the required multiple format maintenance penalty. Sticking with XML minimizes some complications because MiniXML is always be available during a build and it keeps the code a little cleaner. That said, JSON is currently the sexy format, and all the cool kids are doing it. (All technical arguments about JSON aside...) If we conceded to just supporting one additional output format, I would really like to see the XML output further refined.
ogrinfo and gdalinfo as they currently exist are a large collection of printf statements in the main function. I logically removed the diagnostic messages (putting them on stderr) and ensured the intended content was separated into two different formatting functions. The functions are currently responsible for doing their own output to stdout as to prevent the need to completely rewrite the standard output format.
Sorry, for not including an example of the XML sample. I can certainly generate something as necessary. The version I have in the proposed code works but can easily be changed in order to meet the needs and preferences to the project at large.
On Tuesday, November 19, 2013 12:45 PM, Frank Warmerdam <warmerdam at pobox.com> wrote:
Howard,
I was a bit surprised that the RFC doesn't actually define the format. I gather we are supposed to deduce it from the modified ogrinfo code?
On the GDAL side, rather than have gdalinfo support some secondary reporting format, I *feel* it would be better to just have a method on a dataset to provide a summary report somewhat similar to what gdalinfo would give. In XML this would essentially be what you would get from doing a "gdal_translate -of VRT abc.tif abc.vrt ".
I must confess there isn't such a clean analog on the ogrinfo side, and if you want to also capture feature data written out by ogrinfo it gets someone more complicated.
Skimming the (json missing) example ogrinfo it seems like a lot of work - particularly to maintain in a way that will keep all output formats in line.
I started out supportive, but the more I think about the approach the less keen I am.
Best regards,
Frank
On Tue, Nov 19, 2013 at 8:42 AM, Howard Butler <howard at hobu.co> wrote:
All,
>
>Dan Little and myself would like to put forward an RFC proposing -xml and -json output support for both ogrinfo and gdalinfo. No changes are proposed to the current text format (which would continue to be the default output format), but having JSON and XML available would greatly ease the integration of gdalinfo and ogrinfo into existing processing workflows without requiring that someone jump into scripting land. Though it might have been overkill to have an RFC, I thought it would be useful to have something to collaborate on if others have ideas about these particular features.
>
>http://trac.osgeo.org/gdal/wiki/rfc44_gdalinfoxml
>
>We look forward to your feedback,
>
>Howard
>_______________________________________________
>gdal-dev mailing list
>gdal-dev at lists.osgeo.org
>http://lists.osgeo.org/mailman/listinfo/gdal-dev
>
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Software Developer
_______________________________________________
gdal-dev mailing list
gdal-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20131119/940fd8a4/attachment-0001.html>
More information about the gdal-dev
mailing list