Exclude imagery sources more than 20 years old

(closes #3190)
This commit is contained in:
Bryan Housel
2016-06-24 13:22:53 -04:00
parent 7d80494ac5
commit 53bb8a7019
2 changed files with 13 additions and 2467 deletions
+3 -2467
View File
File diff suppressed because it is too large Load Diff
+10
View File
@@ -2,6 +2,10 @@ var fs = require('fs');
var sources = require('editor-layer-index/imagery.json');
var imagery = [];
// ignore imagery more than 20 years old..
var cutoffDate = new Date();
cutoffDate.setFullYear(cutoffDate.getFullYear() - 20);
var blacklist = {
"2u": true,
"Hike & Bike": true,
@@ -49,6 +53,12 @@ sources.concat(whitelist).forEach(function(source) {
if (source.type !== 'tms' && source.type !== 'bing') return;
if (source.name in blacklist) return;
if (source.end_date) {
var endDate = new Date(source.end_date),
isValid = !isNaN(endDate.getTime());
if (isValid && endDate <= cutoffDate) return;
}
var im = {
name: source.name,
type: source.type