Changes between Version 1 and Version 2 of rfc44_gdalinfoxml


Ignore:
Timestamp:
Mar 27, 2015, 5:47:23 AM (9 years ago)
Author:
faza
Comment:

Proposed json format for gdalinfo

Legend:

Unmodified
Added
Removed
Modified
  • rfc44_gdalinfoxml

    v1 v2  
    1818To 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.
    1919
    20 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.
     20== Proposed json format for gdalinfo ==
    2121
     22{{{
     23{
     24    "driver": "GTiff/GeoTIFF",
     25    "files": [ (if -nofl not specified)
     26        "../gcore/data/byte.tif",
     27        "../gcore/data/byte.tif.aux.xml"
     28    ],
     29    "size": [
     30        20,
     31        20
     32    ],
     33    "coordinateSystem": {
     34        "proj": "+proj=.......", (if -proj4 specified)
     35        "wkt": "PROJCS[....]"
     36    },
     37    "gcp": { (if -nogcp not specified)
     38        "proj": "PROJCS[...", (if -proj4 specified)
     39        "gcpList": [
     40            {
     41                "id": "1",
     42                "info": "a",
     43                "pixel": 0.5,
     44                "line": 0.5,
     45                "X": 0.0,
     46                "Y": 0.0,
     47                "Z": 0.0
     48            },
     49            {
     50                "id": "2",
     51                "info": "b",
     52                .
     53                .
     54                .
     55            }
     56        ]
     57    },
     58    "geoTransform": [
     59        440720.000000000000000,
     60        60.000000000000000,
     61        0.0,
     62        3751320.000000000000000,
     63        0.0,
     64        -60.000000000000000
     65    ],
     66    "metadata": { (if -nomd not specified)
     67        "key1": "value1",
     68        "key2": "value2"
     69    },
     70    "imageStructureMetadata": { (if -nomd not specified)
     71        "key1": "value1",
     72        "key2": "value2"
     73    },
     74    "cornerCoordinates": {
     75        "upperLeft": [
     76            440720.000,
     77            3751320.000
     78        ],
     79        "lowerLeft": [
     80            440720.000,
     81            3750120.000
     82        ],
     83        "upperRight": [
     84            441920.000,
     85            3751320.000
     86        ],
     87        "lowerRight": [
     88            441920.000,
     89            3750120.000
     90        ],
     91        "center": [
     92            441320.000,
     93            3750720.000
     94        ]
     95    },
     96    "bands": [
     97        {
     98            "band": 1,
     99            "samples": n, (if -sample specified)
     100            "block": [
     101                20,
     102                20
     103            ],
     104            "type": "Byte",
     105            "colorInterp": "Gray",
     106            "min": 74.000,
     107            "max": 255.000,
     108           
     109            "computedMin": 74.000, (if -mm specified)
     110            "computedMax": 255.000,
     111           
     112            "minimum": 74.000, (if -stats specified)
     113            "maximum": 255.000,
     114            "mean": 126.765,
     115            "stdDev": 22.928,
     116           
     117            "overviews": [
     118                {
     119                    "size": [
     120                        400,
     121                        400 ],
     122                    "checksum": X (if -checksum specified)
     123                },
     124                { "size": [
     125                        200,
     126                        200 ],
     127                    "checksum": X (if -checksum specified)
     128                }
     129            ],
     130            "metadata": { (if -nomd not specified)
     131                "key1": "value1",
     132                "key2": "value2"
     133            },
     134            "histogram": { (if -hist specified)
     135                "count": 25,
     136                "min": -0.5,
     137                "max": 255.5,
     138                "buckets": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
     139            },
     140            "checksum": 4672, (if -checksum specified)
     141            "colorTable": { (if -noct not specified)
     142                "palette": "RGB",
     143                "count": 6,
     144                "entries": [
     145                    [255,255,255,255],
     146                    [255,255,208,255],
     147                    [255,255,204,255],
     148                    [153,204,255,255],
     149                    [0,153,255,255],
     150                    [102,102,102,255]
     151                ]
     152            }
     153        },
     154        {
     155            "band": 2,
     156            "block": [
     157                20,
     158                20
     159            ],
     160            .
     161            .
     162            .
     163        }
     164    ]
     165}
     166}}}
    22167
    23168== Impacted drivers ==