Last active
August 29, 2015 14:17
-
-
Save faza/c43d58be5b9599f0bea5 to your computer and use it in GitHub Desktop.
gdalinfo json format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"driver": "GTiff/GeoTIFF", | |
"files": [ | |
"../gcore/data/byte.tif", | |
"../gcore/data/byte.tif.aux.xml" | |
], | |
"size": [ | |
20, | |
20 | |
], | |
"coordinateSystem": { | |
"proj": "+proj=.......", | |
"wkt": "PROJCS[....]" | |
}, | |
"gcp": { | |
"proj": "PROJCS[...", | |
"gcpList": [ | |
{ | |
"id": "1", | |
"info": "a", | |
"pixel": 0.5, | |
"line": 0.5, | |
"X": 0.0, | |
"Y": 0.0, | |
"Z": 0.0 | |
} | |
] | |
}, | |
"origin": [ | |
440720.000000000000000, | |
3751320.000000000000000 | |
], | |
"pixelSize": [ | |
60.000000000000000, | |
-60.000000000000000 | |
], | |
"metadata": { | |
"AREA_OR_POINT": "Area" | |
}, | |
"imageStructureMetadata": { | |
"INTERLEAVE": "BAND" | |
}, | |
"cornerCoordinates": { | |
"upperLeft": [ | |
440720.000, | |
3751320.000 | |
], | |
"lowerLeft": [ | |
440720.000, | |
3750120.000 | |
], | |
"upperRight": [ | |
441920.000, | |
3751320.000 | |
], | |
"lowerRight": [ | |
441920.000, | |
3750120.000 | |
], | |
"center": [ | |
441320.000, | |
3750720.000 | |
] | |
}, | |
"bands": [ | |
{ | |
"band": 1, | |
"block": [ | |
20, | |
20 | |
], | |
"type": "Byte", | |
"colorInterp": "Gray", | |
"min": 74.000, | |
"max": 255.000, | |
"computedMin": 74.000, | |
"computedMax": 255.000, | |
"minimum": 74.000, | |
"maximum": 255.000, | |
"mean": 126.765, | |
"stdDev": 22.928, | |
"overviews": [ | |
{ | |
"size": [ | |
400, | |
400 ], | |
"checksum": X (if -checksum specified) | |
}, | |
{ "size": [ | |
200, | |
200 ], | |
"checksum": X (if -checksum specified) | |
} | |
], | |
"metadata": { | |
"STATISTICS_MAXIMUM": "255", | |
"STATISTICS_MEAN": "126.765", | |
"STATISTICS_MINIMUM": "74", | |
"STATISTICS_STDDEV": "22.928470838676" | |
}, | |
"histogram": { | |
"count": 25, | |
"min": -0.5, | |
"max": 255.5, | |
"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] | |
}, | |
"checksum": 4672, | |
"colorTable": { | |
"palette": "RGB", | |
"count": 6, | |
"entries": [ | |
[255,255,255,255], | |
[255,255,208,255], | |
[255,255,204,255], | |
[153,204,255,255], | |
[0,153,255,255], | |
[102,102,102,255] | |
] | |
} | |
} | |
] | |
} |
I'd encourage you to remove the spaces from the key strings (CoordinateSystem, CornerCoordinates, ... would be better). Actually in JSON, keys are generally with camelCase convention, so coordinateSystem, cornerCoordinates, etc...
For coordinateSystem, you could have a dictionary like
"coordinateSystem": {
"proj": "+proj=.......",
"wkt": "PROJCS[....]"
Yes the full WKT string is a string that cannot easily been represented more naturally as a JSon objet. In your example, I think you might have quoting issues by the way due to the presence of " inside WKT itself.
Metadata should be represented as JSON dictionary.
"metadata" : {
"KEY1": "value1",
"KEY2":"value2
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I tried representing output of test1 in test_gdalinfo.py in json format.
What should i do in case of "Coordinate System" and "Metadata"? Is it ok to store the entire thing as a string or should i parse it and create key value pairs?