Switch references from editor-layer-index -> imagery-index

- remove the update_imagery script and steps to run it
  (this happens at runtime now)
- update privacy policy, faq, release notes, readme
This commit is contained in:
Bryan Housel
2020-03-12 15:25:09 -04:00
parent dbe643aeac
commit 50353cf596
11 changed files with 343 additions and 77892 deletions
+5 -6
View File
@@ -122,7 +122,6 @@ function buildData() {
minifyJSON('data/address_formats.json', 'dist/data/address_formats.min.json'),
minifyJSON('data/deprecated.json', 'dist/data/deprecated.min.json'),
minifyJSON('data/discarded.json', 'dist/data/discarded.min.json'),
minifyJSON('data/imagery.json', 'dist/data/imagery.min.json'),
minifyJSON('data/intro_graph.json', 'dist/data/intro_graph.min.json'),
minifyJSON('data/keepRight.json', 'dist/data/keepRight.min.json'),
minifyJSON('data/languages.json', 'dist/data/languages.min.json'),
@@ -772,16 +771,16 @@ function translationsToYAML(translations) {
function writeEnJson(tstrings) {
const readCoreYaml = readFileProm('data/core.yaml', 'utf8');
const readImagery = readFileProm('node_modules/editor-layer-index/i18n/en.yaml', 'utf8');
const readImagery = readFileProm('node_modules/@ideditor/imagery-index/i18n/en.yaml', 'utf8');
const readCommunity = readFileProm('node_modules/osm-community-index/i18n/en.yaml', 'utf8');
return Promise.all([readCoreYaml, readImagery, readCommunity])
.then(data => {
let core = YAML.load(data[0]);
let imagery = YAML.load(data[1]);
let community = YAML.load(data[2]);
const core = YAML.load(data[0]);
const imagery = YAML.load(data[1]);
const community = YAML.load(data[2]);
let enjson = core;
const enjson = core;
enjson.en.presets = tstrings;
enjson.en.imagery = imagery.en.imagery;
enjson.en.community = community.en;
-6
View File
@@ -29,13 +29,7 @@ if [[ "${rev}" != "${orig}" ]] ; then
npm install > /dev/null 2>&1
fi
# pull latest imagery
rm -rf node_modules/editor-layer-index/
git clone https://github.com/osmlab/editor-layer-index.git node_modules/editor-layer-index > /dev/null 2>&1
rm -rf node_modules/editor-layer-index/.git/
# build everything
npm run imagery
npm run all
# pull latest translations
-203
View File
@@ -1,203 +0,0 @@
/* eslint-disable no-console */
const fs = require('fs');
const sources = require('editor-layer-index/imagery.json');
const prettyStringify = require('json-stringify-pretty-compact');
let imagery = [];
// ignore imagery more than 20 years old..
let cutoffDate = new Date();
cutoffDate.setFullYear(cutoffDate.getFullYear() - 20);
const keep = [
// Add custom sources here if needed.
{
id: 'Maxar-Premium',
name: 'Maxar Premium Imagery (Beta)',
type: 'tms',
default: true,
attribution: {
required: true,
text: 'Terms & Feedback',
url: 'https://wiki.openstreetmap.org/wiki/DigitalGlobe'
},
description: 'Maxar Premium is a mosaic composed of Maxar basemap with select regions filled with +Vivid or custom area of interest imagery, 50cm resolution or better, and refreshed more frequently with ongoing updates.',
icon: 'https://osmlab.github.io/editor-layer-index/sources/world/Maxar.png',
max_zoom: 22,
url: '7586487389962e3f6e31ab2ed8ca321f2f3fe2cf87f1dedce8fc918b4692efd86fcd816ab8a35303effb1be9abe39b1cce3fe6db2c740044364ae68560822c88373d2c784325baf4e1fa007c6dbedab4cea3fa0dd86ee0ae4feeef032d33dcac28e4b16c90d55a42087c6b66526423ea1b4cc7e63c613940eb1c60f48270060bf41c5fcb6a628985ebe6801e9e71f041cc9f8df06b0345600376663e7dc1cdbc7df16876d8b5d006ed5782e6af4bfe2ff5a292',
encrypted: true
}, {
id: 'Maxar-Standard',
name: 'Maxar Standard Imagery (Beta)',
type: 'tms',
default: true,
attribution: {
required: true,
text: 'Terms & Feedback',
url: 'https://wiki.openstreetmap.org/wiki/DigitalGlobe'
},
description: 'Maxar Standard is a curated set of imagery covering 86% of the earths landmass, with 30-60cm resolution where available, backfilled by Landsat. Average age is 2.31 years, with some areas updated 2x per year.',
icon: 'https://osmlab.github.io/editor-layer-index/sources/world/Maxar.png',
max_zoom: 22,
url: '7586487389962e3f6e31ab2ed8ca321f2f3fe2cf87f1dedce8fc918b4692efd86fcd816ab8a35303effb1be9abe39b1cce3fe6db2c740044364ae68560822c88373d2c784325baf4e1fa007c6dbedab4cea3fa0dd86ee0ae4feeef032d33dcac28e4b16c90d55a42087c6b66526423ea1b4cc7e63c613940eb1c60f48270060bf41c5fcb6a628985ebe6801e9e71f010c8c9d7fb6b534560012461377dc1cdb672f16827dfe0d005bf5685b7ac4ea97cf5f795',
encrypted: true
}
];
const discard = {
'osmbe': true, // 'OpenStreetMap (Belgian Style)'
'osmfr': true, // 'OpenStreetMap (French Style)'
'osm-mapnik-german_style': true, // 'OpenStreetMap (German Style)'
'HDM_HOT': true, // 'OpenStreetMap (HOT Style)'
'osm-mapnik-black_and_white': true, // 'OpenStreetMap (Standard Black & White)'
'osm-mapnik-no_labels': true, // 'OpenStreetMap (Mapnik, no labels)'
'OpenStreetMap-turistautak': true, // 'OpenStreetMap (turistautak)'
'hike_n_bike': true, // 'Hike & Bike'
'landsat': true, // 'Landsat'
'skobbler': true, // 'Skobbler'
'public_transport_oepnv': true, // 'Public Transport (ÖPNV)'
'tf-cycle': true, // 'Thunderforest OpenCycleMap'
'tf-landscape': true, // 'Thunderforest Landscape'
'qa_no_address': true, // 'QA No Address'
'wikimedia-map': true, // 'Wikimedia Map'
'openinframap-petroleum': true,
'openinframap-power': true,
'openinframap-telecoms': true,
'openpt_map': true,
'openrailwaymap': true,
'openseamap': true,
'opensnowmap-overlay': true,
'US-TIGER-Roads-2012': true,
'US-TIGER-Roads-2014': true,
'Waymarked_Trails-Cycling': true,
'Waymarked_Trails-Hiking': true,
'Waymarked_Trails-Horse_Riding': true,
'Waymarked_Trails-MTB': true,
'Waymarked_Trails-Skating': true,
'Waymarked_Trails-Winter_Sports': true,
'OSM_Inspector-Addresses': true,
'OSM_Inspector-Geometry': true,
'OSM_Inspector-Highways': true,
'OSM_Inspector-Multipolygon': true,
'OSM_Inspector-Places': true,
'OSM_Inspector-Routing': true,
'OSM_Inspector-Tagging': true,
'EOXAT2018CLOUDLESS': true
};
const supportedWMSProjections = {
'EPSG:4326': true,
'EPSG:3857': true,
'EPSG:900913': true,
'EPSG:3587': true,
'EPSG:54004': true,
'EPSG:41001': true,
'EPSG:102113': true,
'EPSG:102100': true,
'EPSG:3785': true
};
sources.concat(keep).forEach(source => {
if (source.type !== 'tms' && source.type !== 'wms' && source.type !== 'bing') return;
if (source.id in discard) return;
let im = {
id: source.id,
name: source.name,
type: source.type,
template: source.url
};
// Some sources support 512px tiles
if (source.id === 'Mapbox') {
im.template = im.template.replace('.jpg', '@2x.jpg');
im.tileSize = 512;
} else if (source.id === 'mtbmap-no') {
im.tileSize = 512;
}
// Some WMS sources are supported, check projection
if (source.type === 'wms') {
const projection = (source.available_projections || []).find(p => supportedWMSProjections[p]);
if (!projection) return;
if (sources.some(other => other.name === source.name && other.type !== source.type)) return;
im.projection = projection;
}
let startDate, endDate, isValid;
if (source.end_date) {
endDate = new Date(source.end_date);
isValid = !isNaN(endDate.getTime());
if (isValid) {
if (endDate <= cutoffDate) return; // too old
im.endDate = endDate;
}
}
if (source.start_date) {
startDate = new Date(source.start_date);
isValid = !isNaN(startDate.getTime());
if (isValid) {
im.startDate = startDate;
}
}
let extent = source.extent || {};
if (extent.min_zoom || extent.max_zoom) {
im.zoomExtent = [
extent.min_zoom || 0,
extent.max_zoom || 22
];
}
if (extent.polygon) {
im.polygon = extent.polygon;
} else if (extent.bbox) {
im.polygon = [[
[extent.bbox.min_lon, extent.bbox.min_lat],
[extent.bbox.min_lon, extent.bbox.max_lat],
[extent.bbox.max_lon, extent.bbox.max_lat],
[extent.bbox.max_lon, extent.bbox.min_lat],
[extent.bbox.min_lon, extent.bbox.min_lat]
]];
}
if (source.id === 'mapbox_locator_overlay') {
im.overzoom = false;
}
const attribution = source.attribution || {};
if (attribution.url) {
im.terms_url = attribution.url;
}
if (attribution.text) {
im.terms_text = attribution.text;
}
if (attribution.html) {
im.terms_html = attribution.html;
}
['best', 'default', 'description', 'encrypted', 'icon', 'overlay', 'tileSize'].forEach(prop => {
if (source[prop]) {
im[prop] = source[prop];
}
});
imagery.push(im);
});
imagery.sort((a, b) => a.name.localeCompare(b.name));
fs.writeFileSync('data/imagery.json', prettyStringify(imagery));
fs.writeFileSync('dist/data/imagery.min.json', JSON.stringify(imagery));