= RFC 44: Add Parseable Output Formats for ogrinfo and gdalinfo = Author: Dan "Ducky" Little[[BR]] Contact: danlittle at yahoo dot com [[BR]] == Summary == Add XML and JSON output to the ogrinfo and gdalinfo utilities. == Background == ogrinfo and gdalinfo are incredibly useful metadata gathering tools. Their native text-based output formats, however, are not easily parseable by common external tools. Both XML and JSON are easily parsed and adding those output formats would substantially increase the utility for those looking to add the ogrinfo and gdalinfo utilities to a scripting stack. == Implementation == An example implementation can be seen at the following github fork https://github.com/theduckylittle/gdal/blob/trunk/gdal/apps/ogrinfo.cpp To add the XML output to each utility will require "breaking up" the main loop into contingent chunks. All diagnostic messages will also need to be moved to STDERR to ensure that output on STDOUT is always parseable. The XML representation will be constructed using the MiniXML library built into GDAL. JSON output is only proposed at this point. I hope to piggy-back off of the code developed for GeoJSON output and properly build JSON output into the binaries only when an apporpiate C-JSON library is available. == Impacted drivers == None. == Impacted utilities == gdalinfo * Adds a "-xml" output option. * Adds a "-json" output option. ogrinfo * Adds a "-xml" output option. * Adds a "-json" output option. == Backward Compatibility == This change has no impact on backward compatibility at the C API/ABI and C++ API/ABI levels. Default output will remain the same. The new XML output will only effect users who specify "-xml" or "-json" on the command line. == Testing == The Python autotest suite will be extended to test the new XML/JSON outputs and existing tests will be modified to check STDERR for diagnostic messages. == Ticket == No tickets. == Voting history == Proposed.