Interactive interface for browsing global, full-resolution satellite imagery
Updating scripts to support multiple colormap hrefs
Matthew Cechini8b0e0e901993
diff --git a/bin/wv-options-fetch b/bin/wv-options-fetchindex 89d6cf8bb..d2ae4283f 100755--- a/bin/wv-options-fetch+++ b/bin/wv-options-fetch@@ -66,10 +66,12 @@ def process_remote(entry):global warning_countwarning_count += 1else:- colormap_link = layer["ows:Metadata"]["@xlink:href"]- colormap_file = os.path.basename(colormap_link)- colormap_id = os.path.splitext(colormap_file)[0]- colormaps[colormap_id] = colormap_link+ for item in layer["ows:Metadata"]:+ if item["@xlink:role"] == "http://earthdata.nasa.gov/gibs/metadata-type/colormap/1.2":+ colormap_link = item["@xlink:href"]+ colormap_file = os.path.basename(colormap_link)+ colormap_id = os.path.splitext(colormap_file)[0]+ colormaps[colormap_id] = colormap_linkdef process_colormaps():print "%s: Fetching %d colormaps" % (prog, len(colormaps))@@ -88,6 +90,7 @@ def process_colormaps():(prog, link, str(e)))global warning_countwarning_count += 1+ print "%s: Fetching2 %d colormaps" % (prog, len(colormaps))tolerant = config.get("tolerant", False)if "wv-options-fetch" in config:diff --git a/bin/wv-options-wmts b/bin/wv-options-wmtsindex 565d68ba3..f35a53953 100755--- a/bin/wv-options-wmts+++ b/bin/wv-options-wmts@@ -118,13 +118,15 @@ def process_layer(gc_layer, wv_layers, colormaps):global total_warning_counttotal_warning_count += 1else:- # FIXME: Assumes that there is only one metdata element- colormap_link = gc_layer["ows:Metadata"]["@xlink:href"]- colormap_file = os.path.basename(colormap_link)- colormap_id = os.path.splitext(colormap_file)[0]- wv_layer["palette"] = {- "id": colormap_id- }+ for item in gc_layer["ows:Metadata"]:+ if item["@xlink:role"] == "http://earthdata.nasa.gov/gibs/metadata-type/colormap/1.2":+ colormap_link = item["@xlink:href"]+ colormap_file = os.path.basename(colormap_link)+ colormap_id = os.path.splitext(colormap_file)[0]++ wv_layer["palette"] = {+ "id": colormap_id+ }def process_entry(entry, colormaps):layer_count = 0