<commit_before>var fs = require('fs');
var sources = require('editor-layer-index/imagery.json');
var imagery = [];

var blacklist = {
    "TIGER 2012 Roads Overlay": true
};

var whitelist = [{
    "name": "Locator Overlay",
    "url": "http://{switch:a,b,c}.tiles.mapbox.com/v4/openstreetmap.map-inh76ba2/{zoom}/{x}/{y}.png?access_token=<KEY>",
    "description": "Shows major features to help orient you.",
    "overlay": true,
    "default": true,
    "extent": { "max_zoom": 16 },
    "type": "tms",
    "attribution": {
        "url": "http://www.mapbox.com/about/maps/",
        "text": "Terms & Feedback"
    }
},{
    "id": "MAPNIK",
    "name": "OpenStreetMap (Standard)",
    "url": "http://{switch:a,b,c}.tile.openstreetmap.org/{zoom}/{x}/{y}.png",
    "description": "The default OpenStreetMap layer.",
    "default": true,
    "extent": { "max_zoom": 19 },
    "type": "tms",
    "attribution": {
        "url": "http://openstreetmap.org/",
        "text": "\u00a9 OpenStreetMap contributors, CC-BY-SA"
    }
}];

var descriptions = {
    'Mapbox Satellite': 'Satellite and aerial imagery.',
    'Bing aerial imagery': 'Satellite and aerial imagery.'
};

sources.concat(whitelist).forEach(function(source) {
    if (source.type !== 'tms' && source.type !== 'bing')
        return;
    if (source.name in blacklist)
        return;

    var im = {
        name: source.name,
        type: source.type
    };

    var description = source.description || descriptions[im.name];
    if (description) im.description = description;

    im.template = source.url;

    var extent = source.extent || {};

    if (extent.min_zoom || extent.max_zoom) {
        im.scaleExtent = [
            extent.min_zoom || 0,
            extent.max_zoom || 20
        ];
    }

    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.name == 'Locator Overlay') {
        im.overzoom = false;
    }<commit_msg>Update imagery blacklist/whitelists to match editor_layer_index (revert of aaaf830, closes #2941)<commit_after>var fs = require('fs');
var sources = require('editor-layer-index/imagery.json');
var imagery = [];

var blacklist = {
    "2u": true,
    "Hike & Bike": true,
    "OpenCycleMap": true,
    "OpenStreetMap (German Language)": true,
    "OpenStreetMap (German Style)": true,
    "OpenStreetMap (Sorbian Language)": true,
    "MapQuest OSM": true,
    "OpenStreetMap (Standard Black & White)": true,
    "Skobbler": true,

    "Stadtplan Z\u00fcrich": true, // https://github.com/osmlab/editor-imagery-index/issues/14
    "Public Transport (\u00d6PNV)": true, // https://github.com/osmlab/editor-imagery-index/issues/15

    "TIGER 2012 Roads Overlay": true, // https://github.com/openstreetmap/iD/pull/2010,

    "Waymarked Trails: Cycling": true,
    "Waymarked Trails: Hiking": true,
    "Waymarked Trails: MTB": true,
    "Waymarked Trails: Skating": true,
    "Waymarked Trails: Winter Sports": true,

    "OSM Inspector: Geometry": true,
    "OSM Inspector: Highways": true,
    "OSM Inspector: Multipolygon": true,
    "OSM Inspector: Places": true,
    "OSM Inspector: Tagging": true,
    "OSM Inspector: Addresses (EU)": true,
    "OSM Inspector: Boundaries (EU)": true,
    "OSM Inspector: Routing (EU)": true,

    "QA No Address": true
};

var whitelist = [
    // Add custom sources here if needed.
];

var descriptions = {
    'Mapbox Satellite': 'Satellite and aerial imagery.',
    'Bing aerial imagery': 'Satellite and aerial imagery.',
    'OpenStreetMap (Standard)': 'The default OpenStreetMap layer.'
};

sources.concat(whitelist).forEach(function(source) {
    if (source.type !== 'tms' && source.type !== 'bing') return;
    if (source.name in blacklist) return;

    var im = {
        name: source.name,
        type: source.type
    };

    var description = source.description || descriptions[im.name];
    if (description) im.description = description;

    im.template = source.url;

    var extent = source.extent || {};
    if (extent.min_zoom || extent.max_zoom) {
        im.scaleExtent = [
            extent.min_zoom || 0,
            extent.max_zoom || 20
        ];
    }

    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.name === 'Locator Overlay') {
        im.overzoom = false;
    }
{'fraction_non_alphanumeric': 0.15827482447342026, 'fraction_numerical': 0.009227683049147442, 'mean_word_length': 2.7015590200445434, 'pattern_counts': {'":': 49, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 3, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4588275', 'n_tokens_mistral': 1816, 'n_tokens_neox': 1685, 'n_words': 366}