Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Merge vector data files and add as vectorData to config on build

ZachTRice1c825f927929
diff --git a/tasks/buildOptions.sh b/tasks/buildOptions.sh
index 3b5f70edd..d32e7155d 100755
--- a/tasks/buildOptions.sh
+++ b/tasks/buildOptions.sh
@@ -82,13 +82,13 @@ fi
# Run processVectorData.py and move vectordata where we want them
if [ -e "$BUILD_DIR/vectordata" ] ; then
- mkdir -p "$BUILD_DIR"/config/vectordata
+ mkdir -p "$BUILD_DIR"/config/wv.json/vectordata
if [ -d "$BUILD_DIR"/gc/vectordata ] ; then
cp -r "$BUILD_DIR"/gc/vectordata "$BUILD_DIR"
fi
"$TASKS_DIR/processVectorData.py" "$OPT_DIR/$OPT_SUBDIR/config.json" \
"$BUILD_DIR/vectordata" \
- "$BUILD_DIR/config/vectordata"
+ "$BUILD_DIR/config/wv.json/vectordata"
fi
# Run processColormap.py and move colormaps where we want them
diff --git a/tasks/extractConfigFromWMTS.py b/tasks/extractConfigFromWMTS.py
index 49856fcde..6e230d37c 100755
--- a/tasks/extractConfigFromWMTS.py
+++ b/tasks/extractConfigFromWMTS.py
@@ -52,7 +52,7 @@ total_warning_count = 0
total_error_count = 0
json_options = {}
-json_options["indent"] = 4
+json_options["indent"] = 2
json_options["separators"] = (',', ': ')
class SkipException(Exception):
diff --git a/tasks/mergeConfig.py b/tasks/mergeConfig.py
index 90f90b373..88d493d1a 100755
--- a/tasks/mergeConfig.py
+++ b/tasks/mergeConfig.py
@@ -64,7 +64,7 @@ for root, dirs, files in os.walk(input_dir):
sys.exit(1)
json_options = {}
-json_options["indent"] = 4
+json_options["indent"] = 2
json_options["separators"] = (',', ': ')
with open(output_file, "w") as fp:
diff --git a/tasks/processColormap.py b/tasks/processColormap.py
index a2fd4b8b7..e1a65f3b2 100755
--- a/tasks/processColormap.py
+++ b/tasks/processColormap.py
@@ -220,7 +220,7 @@ def process_file(file):
"maps": maps
}
json_options = {}
- json_options["indent"] = 4
+ json_options["indent"] = 2
json_options["separators"] = (',', ': ')
output_file = os.path.join(output_dir, id + ".json")
diff --git a/tasks/processVectorData.py b/tasks/processVectorData.py
index 69057d81d..6a5b17458 100644
--- a/tasks/processVectorData.py
+++ b/tasks/processVectorData.py
@@ -31,6 +31,18 @@ with open(config_file) as fp:
def copy_file(file):
input_file = os.path.join(root, file)
if input_file.endswith('.json'):
+ response_json = {}
+ vectordata = []
+ with open(input_file) as json_file:
+ initial_data = json.load(json_file)
+ for i in initial_data:
+ vectordata.append({i: initial_data[i]})
+ vector_layer_filename = file;
+ vector_layer_id = vector_layer_filename.split(".", 1)[0]
+ response_json["vectorData"] = {}
+ response_json["vectorData"][vector_layer_id] = vectordata
+ with open(input_file, 'w') as json_file:
+ json.dump(response_json, json_file,indent=2)
shutil.copy(input_file, output_dir)
# Main
diff --git a/tasks/validateOptions.py b/tasks/validateOptions.py
index 9297350a6..cbf89be06 100755
--- a/tasks/validateOptions.py
+++ b/tasks/validateOptions.py
@@ -197,7 +197,7 @@ print "%s: %d error(s), %d warning(s), %d removed" % (prog, error_count,
warning_count, remove_count)
json_options = {}
-json_options["indent"] = 4
+json_options["indent"] = 2
json_options["separators"] = (',', ': ')
with open(main_config_file, "w") as fp: