Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

WV-541: No links in wget when there is no direct data link

Mike McGanna1cc23673137
diff --git a/etc/config/config/products/CIESIN_CHRR_NDH_CYCLONE_HFD.json b/etc/config/config/products/CIESIN_CHRR_NDH_CYCLONE_HFD.json
index 808cbe438..c3ada7622 100644
--- a/etc/config/config/products/CIESIN_CHRR_NDH_CYCLONE_HFD.json
+++ b/etc/config/config/products/CIESIN_CHRR_NDH_CYCLONE_HFD.json
@@ -5,5 +5,6 @@
"collection": "true",
"shortName": "CIESIN_CHRR_NDH_CYCLONE_HFD",
"dataCenterId": "SEDAC"
- }
+ },
+ "noBulkDownload": true
}
\ No newline at end of file
diff --git a/etc/config/config/products/CIESIN_CHRR_NDH_CYCLONE_MRD.json b/etc/config/config/products/CIESIN_CHRR_NDH_CYCLONE_MRD.json
index a01cc3869..87537f4fb 100644
--- a/etc/config/config/products/CIESIN_CHRR_NDH_CYCLONE_MRD.json
+++ b/etc/config/config/products/CIESIN_CHRR_NDH_CYCLONE_MRD.json
@@ -5,5 +5,6 @@
"collection": "true",
"shortName": "CIESIN_CHRR_NDH_CYCLONE_MRD",
"dataCenterId": "SEDAC"
- }
+ },
+ "noBulkDownload": true
}
\ No newline at end of file
diff --git a/etc/config/config/products/CIESIN_CHRR_NDH_CYCLONE_PELRD.json b/etc/config/config/products/CIESIN_CHRR_NDH_CYCLONE_PELRD.json
index 770c82010..100e36190 100644
--- a/etc/config/config/products/CIESIN_CHRR_NDH_CYCLONE_PELRD.json
+++ b/etc/config/config/products/CIESIN_CHRR_NDH_CYCLONE_PELRD.json
@@ -5,5 +5,6 @@
"collection": "true",
"shortName": "CIESIN_CHRR_NDH_CYCLONE_PELRD",
"dataCenterId": "SEDAC"
- }
+ },
+ "noBulkDownload": true
}
\ No newline at end of file
diff --git a/etc/config/config/products/CIESIN_CHRR_NDH_DROUGHT_HFD.json b/etc/config/config/products/CIESIN_CHRR_NDH_DROUGHT_HFD.json
index e5010cc79..d1ea6bded 100644
--- a/etc/config/config/products/CIESIN_CHRR_NDH_DROUGHT_HFD.json
+++ b/etc/config/config/products/CIESIN_CHRR_NDH_DROUGHT_HFD.json
@@ -5,5 +5,6 @@
"collection": "true",
"shortName": "CIESIN_CHRR_NDH_DROUGHT_HFD",
"dataCenterId": "SEDAC"
- }
+ },
+ "noBulkDownload": true
}
diff --git a/etc/config/config/products/CIESIN_CHRR_NDH_DROUGHT_MRD.json b/etc/config/config/products/CIESIN_CHRR_NDH_DROUGHT_MRD.json
index 9ee5f3770..8c306a007 100644
--- a/etc/config/config/products/CIESIN_CHRR_NDH_DROUGHT_MRD.json
+++ b/etc/config/config/products/CIESIN_CHRR_NDH_DROUGHT_MRD.json
@@ -5,5 +5,6 @@
"collection": "true",
"shortName": "CIESIN_CHRR_NDH_DROUGHT_MRD",
"dataCenterId": "SEDAC"
- }
+ },
+ "noBulkDownload": true
}
diff --git a/etc/config/config/products/CIESIN_CHRR_NDH_DROUGHT_PELRD.json b/etc/config/config/products/CIESIN_CHRR_NDH_DROUGHT_PELRD.json
index 74d1dc08e..571a8a3c8 100644
--- a/etc/config/config/products/CIESIN_CHRR_NDH_DROUGHT_PELRD.json
+++ b/etc/config/config/products/CIESIN_CHRR_NDH_DROUGHT_PELRD.json
@@ -5,5 +5,6 @@
"collection": "true",
"shortName": "CIESIN_CHRR_NDH_DROUGHT_PELRD",
"dataCenterId": "SEDAC"
- }
+ },
+ "noBulkDownload": true
}
\ No newline at end of file
diff --git a/etc/config/config/products/CIESIN_CHRR_NDH_FLOOD_HFD.json b/etc/config/config/products/CIESIN_CHRR_NDH_FLOOD_HFD.json
index 6ba953371..e7926dcfb 100644
--- a/etc/config/config/products/CIESIN_CHRR_NDH_FLOOD_HFD.json
+++ b/etc/config/config/products/CIESIN_CHRR_NDH_FLOOD_HFD.json
@@ -5,5 +5,6 @@
"collection": "true",
"shortName": "CIESIN_CHRR_NDH_FLOOD_HFD",
"dataCenterId": "SEDAC"
- }
+ },
+ "noBulkDownload": true
}
\ No newline at end of file
diff --git a/etc/config/config/products/CIESIN_CHRR_NDH_FLOOD_MRD.json b/etc/config/config/products/CIESIN_CHRR_NDH_FLOOD_MRD.json
index 53b10a677..e4097b5e3 100644
--- a/etc/config/config/products/CIESIN_CHRR_NDH_FLOOD_MRD.json
+++ b/etc/config/config/products/CIESIN_CHRR_NDH_FLOOD_MRD.json
@@ -5,5 +5,6 @@
"collection": "true",
"shortName": "CIESIN_CHRR_NDH_FLOOD_MRD",
"dataCenterId": "SEDAC"
- }
+ },
+ "noBulkDownload": true
}
\ No newline at end of file
diff --git a/etc/config/config/products/CIESIN_CHRR_NDH_FLOOD_PELRD.json b/etc/config/config/products/CIESIN_CHRR_NDH_FLOOD_PELRD.json
index 3da58d9d0..48c6ef4a4 100644
--- a/etc/config/config/products/CIESIN_CHRR_NDH_FLOOD_PELRD.json
+++ b/etc/config/config/products/CIESIN_CHRR_NDH_FLOOD_PELRD.json
@@ -5,5 +5,6 @@
"collection": "true",
"shortName": "CIESIN_CHRR_NDH_FLOOD_PELRD",
"dataCenterId": "SEDAC"
- }
+ },
+ "noBulkDownload": true
}
\ No newline at end of file
diff --git a/etc/config/config/products/CIESIN_CHRR_NDH_VOLCANO_HFD.json b/etc/config/config/products/CIESIN_CHRR_NDH_VOLCANO_HFD.json
index b0ccd108c..b6fc64426 100644
--- a/etc/config/config/products/CIESIN_CHRR_NDH_VOLCANO_HFD.json
+++ b/etc/config/config/products/CIESIN_CHRR_NDH_VOLCANO_HFD.json
@@ -5,5 +5,6 @@
"collection": "true",
"shortName": "CIESIN_CHRR_NDH_VOLCANO_HFD",
"dataCenterId": "SEDAC"
- }
+ },
+ "noBulkDownload": true
}
\ No newline at end of file
diff --git a/etc/config/config/products/CIESIN_CHRR_NDH_VOLCANO_MRD.json b/etc/config/config/products/CIESIN_CHRR_NDH_VOLCANO_MRD.json
index af6faa66c..fd409c99e 100644
--- a/etc/config/config/products/CIESIN_CHRR_NDH_VOLCANO_MRD.json
+++ b/etc/config/config/products/CIESIN_CHRR_NDH_VOLCANO_MRD.json
@@ -5,5 +5,6 @@
"collection": "true",
"shortName": "CIESIN_CHRR_NDH_VOLCANO_MRD",
"dataCenterId": "SEDAC"
- }
+ },
+ "noBulkDownload": true
}
\ No newline at end of file
diff --git a/etc/config/config/products/CIESIN_CHRR_NDH_VOLCANO_PELRD.json b/etc/config/config/products/CIESIN_CHRR_NDH_VOLCANO_PELRD.json
index e5536cc9b..ea6b1d84e 100644
--- a/etc/config/config/products/CIESIN_CHRR_NDH_VOLCANO_PELRD.json
+++ b/etc/config/config/products/CIESIN_CHRR_NDH_VOLCANO_PELRD.json
@@ -5,5 +5,6 @@
"collection": "true",
"shortName": "CIESIN_CHRR_NDH_VOLCANO_PELRD",
"dataCenterId": "SEDAC"
- }
+ },
+ "noBulkDownload": true
}
\ No newline at end of file
diff --git a/etc/config/config/products/CIESIN_SEDAC_GRUMPv1_POPCOUNT.json b/etc/config/config/products/CIESIN_SEDAC_GRUMPv1_POPCOUNT.json
index c9ba50102..f392339ad 100644
--- a/etc/config/config/products/CIESIN_SEDAC_GRUMPv1_POPCOUNT.json
+++ b/etc/config/config/products/CIESIN_SEDAC_GRUMPv1_POPCOUNT.json
@@ -5,5 +5,6 @@
"collection": "true",
"shortName": "CIESIN_SEDAC_GRUMPv1_POPCOUNT",
"dataCenterId": "SEDAC"
- }
+ },
+ "noBulkDownload": true
}
\ No newline at end of file
diff --git a/src/data/config.json b/src/data/config.json
index 8cf72fd60..09baee439 100644
--- a/src/data/config.json
+++ b/src/data/config.json
@@ -59923,6 +59923,7 @@
"CIESIN_CHRR_NDH_CYCLONE_HFD": {
"handler": "CollectionList",
"name": "Global Cyclone Hazard Frequency and Distribution",
+ "noBulkDownload": true,
"query": {
"collection": "true",
"dataCenterId": "SEDAC",
@@ -59932,6 +59933,7 @@
"CIESIN_CHRR_NDH_CYCLONE_MRD": {
"handler": "CollectionList",
"name": "Global Cyclone Mortality Risks and Distribution",
+ "noBulkDownload": true,
"query": {
"collection": "true",
"dataCenterId": "SEDAC",
@@ -59941,6 +59943,7 @@
"CIESIN_CHRR_NDH_CYCLONE_PELRD": {
"handler": "CollectionList",
"name": "Global Cyclone Proportional Economic Loss Risk Deciles",
+ "noBulkDownload": true,
"query": {
"collection": "true",
"dataCenterId": "SEDAC",
@@ -59950,6 +59953,7 @@
"CIESIN_CHRR_NDH_DROUGHT_HFD": {
"handler": "CollectionList",
"name": "Global Drought Hazard Frequency and Distribution",
+ "noBulkDownload": true,
"query": {
"collection": "true",
"dataCenterId": "SEDAC",
@@ -59959,6 +59963,7 @@
"CIESIN_CHRR_NDH_DROUGHT_MRD": {
"handler": "CollectionList",
"name": "Global Drought Mortality Risks and Distribution",
+ "noBulkDownload": true,
"query": {
"collection": "true",
"dataCenterId": "SEDAC",
@@ -59968,6 +59973,7 @@
"CIESIN_CHRR_NDH_DROUGHT_PELRD": {
"handler": "CollectionList",
"name": "Global Drought Proportional Economic Loss Risk Deciles",
+ "noBulkDownload": true,
"query": {
"collection": "true",
"dataCenterId": "SEDAC",
@@ -59977,6 +59983,7 @@
"CIESIN_CHRR_NDH_FLOOD_HFD": {
"handler": "CollectionList",
"name": "Global Flood Hazard Frequency and Distribution",
+ "noBulkDownload": true,
"query": {
"collection": "true",
"dataCenterId": "SEDAC",
@@ -59986,6 +59993,7 @@
"CIESIN_CHRR_NDH_FLOOD_MRD": {
"handler": "CollectionList",
"name": "Global Flood Mortality Risks and Distribution",
+ "noBulkDownload": true,
"query": {
"collection": "true",
"dataCenterId": "SEDAC",
@@ -59995,6 +60003,7 @@
"CIESIN_CHRR_NDH_FLOOD_PELRD": {
"handler": "CollectionList",
"name": "Global Flood Proportional Economic Loss Risk Deciles",
+ "noBulkDownload": true,
"query": {
"collection": "true",
"dataCenterId": "SEDAC",
@@ -60004,6 +60013,7 @@
"CIESIN_CHRR_NDH_VOLCANO_HFD": {
"handler": "CollectionList",
"name": "Global Volcano Hazard Frequency and Distribution",
+ "noBulkDownload": true,
"query": {
"collection": "true",
"dataCenterId": "SEDAC",
@@ -60013,6 +60023,7 @@
"CIESIN_CHRR_NDH_VOLCANO_MRD": {
"handler": "CollectionList",
"name": "Global Volcano Mortality Risks and Distribution",
+ "noBulkDownload": true,
"query": {
"collection": "true",
"dataCenterId": "SEDAC",
@@ -60022,6 +60033,7 @@
"CIESIN_CHRR_NDH_VOLCANO_PELRD": {
"handler": "CollectionList",
"name": "Global Volcano Proportional Economic Loss Risk Deciles",
+ "noBulkDownload": true,
"query": {
"collection": "true",
"dataCenterId": "SEDAC",
@@ -60031,6 +60043,7 @@
"CIESIN_SEDAC_GRUMPv1_POPCOUNT": {
"handler": "CollectionList",
"name": "Global Rural-Urban Mapping Project, Version 1 (GRUMPv1): Population Count Grid",
+ "noBulkDownload": true,
"query": {
"collection": "true",
"dataCenterId": "SEDAC",
diff --git a/src/js/Worldview/DataDownload/DownloadListPanel.js b/src/js/Worldview/DataDownload/DownloadListPanel.js
index 1aea8594e..54b5b1087 100644
--- a/src/js/Worldview/DataDownload/DownloadListPanel.js
+++ b/src/js/Worldview/DataDownload/DownloadListPanel.js
@@ -73,10 +73,12 @@ Worldview.DataDownload.DownloadListPanel = function(config, model) {
$.each(model.selectedGranules, function(key, granule) {
if ( !selection[granule.product] ) {
+ productConfig = config.products[granule.product];
selection[granule.product] = {
- name: config.products[granule.product].name,
+ name: productConfig.name,
granules: [granule],
- counts: {}
+ counts: {},
+ noBulkDownload: productConfig.noBulkDownload || false,
};
} else {
selection[granule.product].granules.push(granule);
@@ -147,6 +149,16 @@ Worldview.DataDownload.DownloadListPanel = function(config, model) {
return selection;
};
+ var isBulkDownloadable = function() {
+ var result = false;
+ $.each(selection, function(index, product) {
+ if ( !product.noBulkDownload ) {
+ result = true;
+ }
+ });
+ return result;
+ };
+
var reformatLink = function(link) {
// For title, take it if found, otherwise, use the basename of the
// URI
@@ -168,13 +180,21 @@ Worldview.DataDownload.DownloadListPanel = function(config, model) {
return elements.join("\n");
};
- var granuleText = function(granule) {
- var elements = [
- "<tr>",
- "<td>" + granule.label + "</td>",
- "<td>" + linksText(granule.links) + "</td>",
- "</tr>"
- ];
+ var granuleText = function(product, granule) {
+ if ( product.name !== granule.label ) {
+ var elements = [
+ "<tr>",
+ "<td>" + granule.label + "</td>",
+ "<td>" + linksText(granule.links) + "</td>",
+ "</tr>"
+ ];
+ } else {
+ var elements = [
+ "<tr>",
+ "<td colspan='2'>" + linksText(granule.links) + "</td>",
+ "</tr>"
+ ];
+ }
return elements.join("\n");
};
@@ -192,18 +212,22 @@ Worldview.DataDownload.DownloadListPanel = function(config, model) {
elements.push("<table>");
$.each(product.list, function(index, item) {
- elements.push(granuleText(item));
+ elements.push(granuleText(product, item));
});
elements.push("</table>");
return elements.join("\n");
};
var bodyText = function() {
+ var bulk = "";
+ if ( isBulkDownloadable() ) {
+ bulk = "<div class='wget'>" +
+ "<a class='wget' href='#'>Bulk Download (wget)</a>" +
+ "</div>";
+ }
var elements = [
NOTICE,
- "<div class='wget'>",
- "<a class='wget' href='#'>Bulk Download (wget)</a>",
- "</div>"
+ bulk,
];
$.each(selection, function(key, product) {
elements.push(productText(product));
diff --git a/src/js/Worldview/DataDownload/WgetPage.js b/src/js/Worldview/DataDownload/WgetPage.js
index 502504bcb..022488fc0 100644
--- a/src/js/Worldview/DataDownload/WgetPage.js
+++ b/src/js/Worldview/DataDownload/WgetPage.js
@@ -91,15 +91,33 @@ Worldview.DataDownload.WgetPage = (function() {
};
var writeProduct = function(doc, product) {
+ console.log(product);
doc.write("<h4>" + product.name + "</h4>");
+ if ( product.noBulkDownload ) {
+ doc.write("<p>" +
+ "These granules are not available for bulk download. " +
+ "Please visit each link and download manually." +
+ "</p>");
+ }
$.each(product.list, function(index, item) {
- doc.write("<div class='label'>" + item.label + "</div>");
+ // Don't print twice if the item and product names are the same.
+ if ( item.label !== product.name ) {
+ doc.write("<div class='label'>" + item.label + "</div>");
+ }
$.each(item.links, function(index, link) {
- doc.write(
- "<div>" +
- "<a href='" + link.href + "'>" + link.href + "</a>" +
- "</div>"
- );
+ if ( !product.noBulkDownload ) {
+ doc.write(
+ "<div>" +
+ "<a href='" + link.href + "'>" + link.href + "</a>" +
+ "</div>"
+ );
+ } else {
+ doc.write(
+ "<div class='label'>" +
+ link.href +
+ "</div>"
+ );
+ }
});
});
};
diff --git a/src/service/echo.cgi b/src/service/echo.cgi
index 6ac32201c..7c74cf89b 100755
--- a/src/service/echo.cgi
+++ b/src/service/echo.cgi
@@ -253,7 +253,7 @@ def process_request(options):
raise RequestError("Missing parameter: %s" % required_field)
xml = None
- if "collections" not in fields:
+ if "collection" not in fields:
xml = create_xml(fields)
if options.xml: