Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

updates

Jason Kent09ad7d9463ab
diff --git a/tasks/python3/getVisMetadata.py b/tasks/python3/getVisMetadata.py
index 907e34499..2800e0033 100755
--- a/tasks/python3/getVisMetadata.py
+++ b/tasks/python3/getVisMetadata.py
@@ -2,11 +2,8 @@
from concurrent.futures import ThreadPoolExecutor
from optparse import OptionParser
-from pprint import pprint as pp
-from util import dict_merge
import os
import json
-import sys
import urllib3
import certifi
http = urllib3.PoolManager(
@@ -14,19 +11,26 @@ http = urllib3.PoolManager(
ca_certs=certifi.where()
)
prog = os.path.basename(__file__)
-
-gibs_url = 'localhost:8080/layer-metadata/v1.0/'
-
parser = OptionParser(usage="Usage: %s <input_file> <output_file>" % prog)
(options, args) = parser.parse_args()
input_file = args[0]
output_file = args[1]
+
+gibs_url = 'localhost:8080/layer-metadata/v1.0/'
+remove_keys = ['measurement']
layer_metadata = {}
def get_metadata(layer_id):
response = http.request('GET', gibs_url + layer_id + '.json')
layer_metadata[layer_id] = json.loads(response.data.decode('utf-8'))
+ # Remove any props we don't expect to use
+ for key in remove_keys:
+ layer_metadata[layer_id].pop(key, None)
+
+ # TODO consider also removing any keys found in the corresponding WV config
+ # as a way of letting those properties take precedence over vis metadata?
+
#MAIN
if __name__ == "__main__":
with open(input_file, 'rt') as layer_order: