Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Legened for SEDAC population, install script for python dependencies, opacity for WMS layers

Mike McGannd5a50f4025cf
diff --git a/.gitignore b/.gitignore
index 7d78d6924..a400aecae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
build
dist
node_modules
+python
.project
.settings
.pydevproject
diff --git a/Gruntfile.js b/Gruntfile.js
index 09e87e146..aa99d7d66 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -114,7 +114,7 @@ module.exports = function(grunt) {
exec: {
config: {
- command: "bin/make-conf"
+ command: "PATH=python/bin:${PATH} bin/make-conf"
},
// After removing JavaScript and CSS files that are no longer
diff --git a/README.md b/README.md
index 5dd0feeb5..829573886 100644
--- a/README.md
+++ b/README.md
@@ -160,6 +160,12 @@ for building:
npm install
+Some python libraries are required. Run the following script which will
+globally install virtualenv (requires root), and then installs the libraries
+in the python directory:
+
+ ./python_install
+
To create a version that is ready to deployed to a web server, issue the
following:
diff --git a/conf/sld/grump-v1-population-count_2000.xml b/conf/sld/grump-v1-population-count_2000.xml
index abf15b5a2..298ea70d4 100644
--- a/conf/sld/grump-v1-population-count_2000.xml
+++ b/conf/sld/grump-v1-population-count_2000.xml
@@ -7,14 +7,14 @@
<FeatureTypeStyle>
<Rule>
<RasterSymbolizer>
- <ColorMap type="values">
+ <ColorMap>
<ColorMapEntry color="#000000" opacity="0" label="No Data"/>
- <ColorMapEntry color="#feff76" label="1 - 5"/>
- <ColorMapEntry color="#fcdf50" label="5.1 - 25"/>
- <ColorMapEntry color="#f7bc2b" label="25.1 - 50"/>
- <ColorMapEntry color="#d68606" label="50.1 - 100"/>
- <ColorMapEntry color="#9e4400" label="100.1 - 250"/>
- <ColorMapEntry color="#6b0400" label="250+"/>
+ <ColorMapEntry color="#feff76" label="1 - 5 persons/sq km"/>
+ <ColorMapEntry color="#fcdf50" label="5.1 - 25 persons/sq km"/>
+ <ColorMapEntry color="#f7bc2b" label="25.1 - 50 persons/sq km"/>
+ <ColorMapEntry color="#d68606" label="50.1 - 100 persons/sq km"/>
+ <ColorMapEntry color="#9e4400" label="100.1 - 250 persons/sq km"/>
+ <ColorMapEntry color="#6b0400" label="250+ persons/sq km"/>
</ColorMap>
</RasterSymbolizer>
</Rule>
diff --git a/conf/web/wv.main/layers/sedac/grump-v1-population-count_2000.json b/conf/web/wv.main/layers/sedac/grump-v1-population-count_2000.json
index 49c0a49a1..6e97b35c0 100644
--- a/conf/web/wv.main/layers/sedac/grump-v1-population-count_2000.json
+++ b/conf/web/wv.main/layers/sedac/grump-v1-population-count_2000.json
@@ -18,6 +18,11 @@
"geographic": {
"source": "SEDAC:wms"
}
+ },
+
+ "palette": {
+ "id": "grump-v1-population-count_2000",
+ "classified": "true"
}
}
}
diff --git a/python_install b/python_install
new file mode 100755
index 000000000..d078852b3
--- /dev/null
+++ b/python_install
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# NASA Worldview
+#
+# This code was originally developed at NASA/Goddard Space Flight Center for
+# the Earth Science Data and Information System (ESDIS) project.
+#
+# Copyright (C) 2013 - 2014 United States Government as represented by the
+# Administrator of the National Aeronautics and Space Administration.
+# All Rights Reserved.
+#
+
+BASE_DIR=$(dirname "$0")
+PIP="$BASE_DIR"/python/bin/pip
+
+# virtualenv 1.11 is broken
+# http://stackoverflow.com/questions/20916712/cannot-create-virtualenv-instance-in-python-2-7-5-because-of-pip-installation-er
+sudo easy_install virtualenv==1.10.1
+virtualenv python
+$PIP install xmltodict
+
diff --git a/src/js/Worldview/Map/LayerSet.js b/src/js/Worldview/Map/LayerSet.js
index 32b43d356..757bcdf11 100644
--- a/src/js/Worldview/Map/LayerSet.js
+++ b/src/js/Worldview/Map/LayerSet.js
@@ -108,7 +108,11 @@ Worldview.Map.LayerSet = function(config, projId, layerId) {
};
var options = {
tileSize: new OpenLayers.Size(layer.tileSize[0],
- layer.tileSize[1]), };
+ layer.tileSize[1]),
+ };
+ if ( layer.opacity ) {
+ options.opacity = layer.opacity;
+ }
if ( layer.transition ) {
options.transitionEffect = "resize";
} else {