Opened 20 years ago

Last modified 20 years ago

#617 closed enhancement (wontfix)

XML output format

Reported by: pierrick.brihaye@… Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: minor Keywords:
Cc:

Description

Hi,

It would be nice to have a "General Command Line Switch[es]" that would allow an
XML output for GDAL, OGR... utilities.

This XML could be transformed to feed configuration files for production tools.

Of course, the XML content should be documented and driven by a DTD/Schema.

An --x switch would do the trick, possibly connected with a "creation option"
such as "ENCODING=xxx" that would become useful in case GDAL utilities were
internationalized.

Regards,

p.b.

Change History (5)

comment:1 by warmerdam, 20 years ago

Pierrick,

Could you be more specific about the sort information you are looking for?

If you are wanting information on drivers, the --format switch produces
a report of pretty much everything known about a given driver.

eg. 
warmerda@gdal2200[28]% gdalinfo --format gtiff
Format Details:
  Short Name: GTiff
  Long Name: GeoTIFF
  Extension: tif
  Mime Type: image/tiff
  Help Topic: frmt_gtiff.html
  Supports: Create() - Create writeable dataset.
  Supports: CreateCopy() - Create dataset by copying another.
  Creation Datatypes: Byte UInt16 Int16 UInt32 Int32 Float32 Float64 CInt16 CInt
32 CFloat32 CFloat64

<CreationOptionList>
  <Option name="COMPRESS" type="string-select">
    <Value>NONE</Value>
    <Value>PACKBITS</Value>
    <Value>JPEG</Value>
    <Value>LZW</Value>
    <Value>DEFLATE</Value>
  </Option>
  <Option name="INTERLEAVE" type="string-select">
    <Value>BAND</Value>
    <Value>PIXEL</Value>
  </Option>
  <Option name="TILED" type="boolean" description="Switch to tiled format"/>
  <Option name="TFW" type="boolean" description="Write out world file"/>
  <Option name="BLOCKXSIZE" type="int" description="Tile Width"/>
  <Option name="BLOCKYSIZE" type="int" description="Tile/Strip Height"/>
  <Option name="PHOTOMETRIC" type="string-select">
    <Value>MINISBLACK</Value>
    <Value>MINISWHITE</Value>
    <Value>RGB</Value>
    <Value>CMYK</Value>
    <Value>YCBCR</Value>
    <Value>CIELAB</Value>
    <Value>ICCLAB</Value>
    <Value>ITULAB</Value>
  </Option>
</CreationOptionList>

No work is likely in this area within OGR till it's driver model is
unified with GDALs.  

I realize the above --format output is not all in XML.  Are you just
interested in wrapping all of it as XML? 

comment:2 by pierrick.brihaye@…, 20 years ago

Hi again,

I think ogrinfo/gdalinfo's output would make sense in XML. The same for a
(future) tool like gdalsplit (see http://208.24.120.44/show_bug.cgi?id=604).

Generally speaking; every file or native program description could benefit from
an XML output.

It is a convenient way to get an idea of the GDAL tools capabilities from other
languages (Java, PHP) and to implement a relevant behaviour.

My current ideas are : 
mapping GDAL generated tiles to the Deegree file format for tiles
know whether or not the, say, GeoJP2 format is supported by my precompiled GDAL dll
return error messages to automated processes...

IHMO, it's much easier to deal with XML than with raw non-determinist
OS-encoding-dependant text...

Cheers,

p.b.





comment:3 by warmerdam, 20 years ago

Ah, I see a bit more of what you mean.

This is unlikely to happen in general, though some specific cases might
be addressed at some point. 

For an XML equilvelent to "gdalinfo" I would suggest using gdal_translate
to convert an image to VRT format.  This will essentially be an XML description
of all the image characteristics except for a few specific things (like the
original blocksize, or the name of the original driver).   

I am going to close this as a WONTFIX enhancement, but I'll at least keep the
idea in the back of my mind. 

comment:4 by pierrick.brihaye@…, 20 years ago

Hi,

>For an XML equilvelent to "gdalinfo" I would suggest using gdal_translate
>to convert an image to VRT format.

Mmmh... My objective is to use my native formats :-)

>I am going to close this as a WONTFIX enhancement, but I'll at least keep the
>idea in the back of my mind. 

No problem : my suggestion was just a way to improve interoperability. A
(documented) DTD/Schema driven output would give more consistence to GDAL tools
when used by other tools. 

Cheers,

p.b.

comment:5 by warmerdam, 20 years ago

Pierrick,

With regard to converting to VRT:

Converting to VRT really just creates an XML description file that refers
back to the original file for the actual image data.  So think of it as
a way of creating an XML superstructure around supported file formats. 

Note: See TracTickets for help on using tickets.