import json, webbrowser
from osgeo import gdal, gdal_array
ds = gdal.Open("/vsicurl/http://landsat-pds.s3.amazonaws.com/L8/225/071/LC82250712015212LGN00/LC82250712015212LGN00_B4.TIF")
jsInfo = gdal.Info(ds, format='json')
ds = None
jsExtent = jsInfo['wgs84Extent']
js_to_geojson_io = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": jsExtent
}
]
}
v_json = json.dumps(js_to_geojson_io)
print v_json
{"type": "FeatureCollection", "features": [{"geometry": {"type": "Polygon", "coordinates": [[[-55.1980338, -14.8524218], [-55.1789556, -16.9806545], [-53.0479293, -14.8254994], [-53.0061936, -16.9496626], [-55.1980338, -14.8524218]]]}, "type": "Feature", "properties": {}}]}
url = "http://geojson.io/#data=data:application/json,{0}".format( v_json )
webbrowser.open( url ) # Open geojson.io
True