In [1]:
url_metadata = 'https://finder.eocloud.eu/resto/collections/Landsat7/513a51ad-33b9-5d23-9736-2a288fa90e45.json?&lang=en'
In [5]:
import pandas as pd
pd_json = pd.read_json(url_metadata, orient='colums')
pd_json
Out[5]:
type
id
geometry
properties
bands
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
9
centroid
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
{'type': 'Point', 'coordinates': [145.508665, ...
cloudCover
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
11
collection
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
Landsat7
completionDate
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
2016-11-23T00:24:19.248339Z
coordinates
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
[[[144.40423, -13.50075], [146.63498, -13.5139...
NaN
description
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
None
instrument
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
ETM
keywords
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
[{'id': '62f4365c66c1f64', 'name': 'Oceania', ...
license
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
{'licenseId': 'unlicensed', 'hasToBeSigned': '...
links
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
[{'rel': 'self', 'type': 'application/json', '...
orbitNumber
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
0
organisationName
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
USGS
parentIdentifier
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
None
path
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
96
platform
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
LANDSAT7
processingLevel
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
LEVEL1T
productIdentifier
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
/eodata/Landsat-7/ETM/L1T/2016/11/23/LE7096070...
productType
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
L1T
published
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
2016-12-02T10:19:30.877188Z
quicklook
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
None
resolution
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
60
row
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
70
sensorMode
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
BUMPER
services
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
{'download': {'url': 'http://185.48.233.249/La...
snowCover
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
0
startDate
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
2016-11-23T00:24:19.248339Z
status
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
0
sunAzimuth
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
107.54
sunElevation
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
65.4539
thumbnail
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
https://finder.eocloud.eu/files/Landsat-7/ETM/...
title
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
LE70960702016328ASA00
type
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
Polygon
NaN
updated
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
2016-12-02T10:19:30.877188Z
version
Feature
513a51ad-33b9-5d23-9736-2a288fa90e45
NaN
0
In [6]:
from urllib.request import *
import json
req = Request(url_metadata)
opener = build_opener()
f = opener.open(req)
json_obj = json.loads(f.read())
print(json.dumps(json_obj, indent=3, sort_keys=True))
{
"geometry": {
"coordinates": [
[
[
144.40423,
-13.50075
],
[
146.63498,
-13.51393
],
[
146.6319,
-15.39365
],
[
144.38235,
-15.37856
],
[
144.40423,
-13.50075
]
]
],
"type": "Polygon"
},
"id": "513a51ad-33b9-5d23-9736-2a288fa90e45",
"properties": {
"bands": 9,
"centroid": {
"coordinates": [
145.508665,
-14.4472
],
"type": "Point"
},
"cloudCover": 11,
"collection": "Landsat7",
"completionDate": "2016-11-23T00:24:19.248339Z",
"description": null,
"instrument": "ETM",
"keywords": [
{
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=Oceania",
"id": "62f4365c66c1f64",
"name": "Oceania",
"normalized": "oceania",
"type": "continent"
},
{
"gcover": 0.11,
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=Australia",
"id": "8f36daace0ea948",
"name": "Australia",
"normalized": "australia",
"parentHash": "62f4365c66c1f64",
"type": "country",
"value": 16.83
},
{
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=_all",
"id": "47c44d8523d145e",
"name": "_all",
"normalized": "_all",
"parentHash": "8f36daace0ea948",
"type": "region"
},
{
"gcover": 0.48,
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=Queensland",
"id": "72243e27011ac3a",
"name": "Queensland",
"normalized": "queensland",
"parentHash": "47c44d8523d145e",
"type": "state",
"value": 16.86
},
{
"gcover": 1.05,
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=%22Coral%20Sea%22",
"id": "720dfabb1950aec",
"name": "Coral Sea",
"normalized": "coral-sea",
"type": "sea",
"value": 83.34
},
{
"gcover": 8.86,
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=%22Great%20Barrier%20Reef%22",
"id": "34cdf210b9bec52",
"name": "Great Barrier Reef",
"normalized": "great-barrier-reef",
"type": "reef",
"value": 83.34
},
{
"area": 42386.458369223,
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=Water",
"id": "30ab8d81fb40d6c",
"name": "Water",
"normalized": "water",
"type": "landuse",
"value": 84.1
},
{
"area": 5792.3996521888,
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=Forest",
"id": "5b8cdeb6f99ce56",
"name": "Forest",
"normalized": "forest",
"type": "landuse",
"value": 11.49
},
{
"area": 2628.8464031431,
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=%22Herbaceous%20Area%22",
"id": "870b2149f9a08a2",
"name": "Herbaceous Area",
"normalized": "herbaceous",
"type": "landuse",
"value": 5.21
},
{
"area": 11.427183227747,
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=Desert",
"id": "c963665d6efbb60",
"name": "Desert",
"normalized": "desert",
"type": "landuse",
"value": 0.02
},
{
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=Tropical",
"id": "6f61c304f417a39",
"name": "Tropical",
"type": "location"
},
{
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=Southern",
"id": "d817ecd5e7765d3",
"name": "Southern",
"type": "location"
},
{
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=Coastal",
"id": "8e973c5726ef929",
"name": "Coastal",
"type": "location"
},
{
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=Spring",
"id": "b4de51064131332",
"name": "Spring",
"type": "season"
},
{
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=Landsat7",
"id": "afe34868febad7e",
"name": "Landsat7",
"type": "collection"
},
{
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=L1T",
"id": "1178b8eda6294be",
"name": "L1T",
"type": "productType"
},
{
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=LEVEL1T",
"id": "95d993f8d95dfe3",
"name": "LEVEL1T",
"type": "processingLevel"
},
{
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=landsat7",
"id": "989826ec3b8d1d6",
"name": "landsat7",
"type": "platform"
},
{
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=etm",
"id": "fcd1f3efc0b8986",
"name": "etm",
"parentHash": "989826ec3b8d1d6",
"type": "instrument"
},
{
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=BUMPER",
"id": "1c8fe992f394704",
"name": "BUMPER",
"parentHash": "fcd1f3efc0b8986",
"type": "sensorMode"
},
{
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=2016",
"id": "8fb683ee11c8138",
"name": "2016",
"type": "year"
},
{
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=November",
"id": "8e320952ba42931",
"name": "November",
"parentHash": "8fb683ee11c8138",
"type": "month"
},
{
"href": "https://finder.eocloud.eu/resto/api/collections/Landsat7/search.json?&lang=en&q=23",
"id": "eccc4e1537ae32f",
"name": "23",
"parentHash": "8e320952ba42931",
"type": "day"
}
],
"license": {
"description": {
"shortName": "No license"
},
"grantedCountries": null,
"grantedFlags": null,
"grantedOrganizationCountries": null,
"hasToBeSigned": "never",
"licenseId": "unlicensed",
"signatureQuota": -1,
"viewService": "public"
},
"links": [
{
"href": "https://finder.eocloud.eu/resto/collections/Landsat7/513a51ad-33b9-5d23-9736-2a288fa90e45.json?&lang=en",
"rel": "self",
"title": "GeoJSON link for 513a51ad-33b9-5d23-9736-2a288fa90e45",
"type": "application/json"
}
],
"orbitNumber": 0,
"organisationName": "USGS",
"parentIdentifier": null,
"path": 96,
"platform": "LANDSAT7",
"processingLevel": "LEVEL1T",
"productIdentifier": "/eodata/Landsat-7/ETM/L1T/2016/11/23/LE70960702016328ASA00",
"productType": "L1T",
"published": "2016-12-02T10:19:30.877188Z",
"quicklook": null,
"resolution": 60,
"row": 70,
"sensorMode": "BUMPER",
"services": {
"download": {
"mimeType": "application/unknown",
"size": 709854757,
"url": "http://185.48.233.249/Landsat-7/ETM/L1T/2016/11/23/LE70960702016328ASA00"
}
},
"snowCover": 0,
"startDate": "2016-11-23T00:24:19.248339Z",
"status": 0,
"sunAzimuth": 107.5404935,
"sunElevation": 65.45394107,
"thumbnail": "https://finder.eocloud.eu/files/Landsat-7/ETM/L1T/2016/11/23/LE70960702016328ASA00/LE70960702016328ASA00.jpg",
"title": "LE70960702016328ASA00",
"updated": "2016-12-02T10:19:30.877188Z",
"version": 0
},
"type": "Feature"
}
In [4]:
import json
import uuid
from urllib.request import *
from IPython.display import display_javascript, display_html, display
class RenderJSON(object):
def __init__(self, json_data):
if isinstance(json_data, dict) or isinstance(json_data, list):
self.json_str = json.dumps(json_data)
else:
self.json_str = json_data
self.uuid = str(uuid.uuid4())
def _ipython_display_(self):
display_html('<div id="{}" style="height: 600px; width:100%;font: 12px/18px monospace !important;"></div>'.format(self.uuid), raw=True)
display_javascript("""
require(["https://rawgit.com/caldwell/renderjson/master/renderjson.js"], function() {
renderjson.set_show_to_level(1);
document.getElementById('%s').appendChild(renderjson(%s))
});
""" % (self.uuid, self.json_str), raw=True)
req = Request(url_metadata)
opener = build_opener()
f = opener.open(req)
json_obj = json.loads(f.read())
RenderJSON(json_obj)
In [ ]:
Content source: wasat/JupyTEPIDE
Similar notebooks: