Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Warnings on unexpected layers from GC is now optional

Mike McGann868e53c60f20
diff --git a/bin/wv-options-build b/bin/wv-options-build
index 80cd62f16..4a14c3061 100755
--- a/bin/wv-options-build
+++ b/bin/wv-options-build
@@ -62,4 +62,4 @@ done
cp -r "$BUILD_DIR/brand" "$DEST_DIR"
-"$BIN_DIR"/wv-options-validate "$DEST_DIR/config"
+"$BIN_DIR"/wv-options-validate "$BUILD_DIR/config.json" "$DEST_DIR/config"
diff --git a/bin/wv-options-validate b/bin/wv-options-validate
index 683bc3c40..b785f9e24 100755
--- a/bin/wv-options-validate
+++ b/bin/wv-options-validate
@@ -23,15 +23,16 @@ help_description = """\
Validates and corrects the configuration files.
"""
-parser = OptionParser(usage="Usage: %s <config_dir>" % prog,
+parser = OptionParser(usage="Usage: %s <config_json> <config_dir>" % prog,
version="%s version %s" % (prog, version),
epilog=help_description)
(options, args) = parser.parse_args()
-if len(args) != 1:
+if len(args) != 2:
parser.error("Invalid number of arguments")
-config_dir = args[0]
+options_file = args[0]
+config_dir = args[1]
error_count = 0
warning_count = 0
@@ -50,13 +51,15 @@ def warn(message):
main_config_file = os.path.join(config_dir, "wv.json")
with open(main_config_file) as fp:
wv = json.load(fp)
+with open(options_file) as fp:
+ opt = json.load(fp)
for layer_id in wv["layers"].keys():
layer = wv["layers"][layer_id]
if len(layer["projections"]) == 0:
warn("[%s] No projections defined or not found in GC documents" %
layer_id)
- if layer_id not in wv["layerOrder"]:
+ if "warnOnUnexpectedLayer" in opt and layer_id not in wv["layerOrder"]:
warn("[%s] Unexpected layer" % layer_id)
del wv["layers"][layer_id]
if "palette" in layer: