Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

add metadata logic to python3 code #1682

Benjamin King46ce769f5927
diff --git a/tasks/python3/extractConfigFromWMTS.py b/tasks/python3/extractConfigFromWMTS.py
index 6bf1caab5..deca275e9 100755
--- a/tasks/python3/extractConfigFromWMTS.py
+++ b/tasks/python3/extractConfigFromWMTS.py
@@ -84,7 +84,7 @@ def process_layer(gc_layer, wv_layers, colormaps):
}
# Vector data links
- if "ows:Metadata" in gc_layer:
+ if "ows:Metadata" in gc_layer and gc_layer["ows:Metadata"] is not None:
for item in gc_layer["ows:Metadata"]:
if "@xlink:role" not in item:
raise KeyError("No xlink:role")
diff --git a/tasks/python3/getCapabilities.py b/tasks/python3/getCapabilities.py
index 73d307e6a..6b9b958f4 100755
--- a/tasks/python3/getCapabilities.py
+++ b/tasks/python3/getCapabilities.py
@@ -52,7 +52,7 @@ with open(config_file) as fp:
config = json.load(fp)
def process_vector_data(layer):
- if "ows:Metadata" in layer:
+ if "ows:Metadata" in layer and layer["ows:Metadata"] is not None:
for item in layer["ows:Metadata"]:
schema_version = item["@xlink:role"]
if schema_version == "http://earthdata.nasa.gov/gibs/metadata-type/layer/1.0":