Extract all into file per layer, concatenate to single file
This commit is contained in:
parent
9c3682294e
commit
182edb2ee1
52 changed files with 10344 additions and 2200 deletions
20
layers/collection/1010.geojson
Normal file
20
layers/collection/1010.geojson
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"geometry": null,
|
||||
"properties": {
|
||||
"name": "OpenStreetMap.se",
|
||||
"maxZoom": 18,
|
||||
"attribution": "Map data: © <a href=\"http://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a> contributors, under ODbL | Tiles: © <a href=\"http://openstreetmap.se/\" target=\"_blank\">OpenStreetMap Sweden</a>",
|
||||
"id": "1010",
|
||||
"subdomains": [
|
||||
"a",
|
||||
"b",
|
||||
"c",
|
||||
"d",
|
||||
"e",
|
||||
"f"
|
||||
],
|
||||
"url": "http://{s}.tile.openstreetmap.se/hydda/full/{z}/{x}/{y}.png",
|
||||
"dataSource": "LayersCollection"
|
||||
},
|
||||
"type": "Feature"
|
||||
}
|
||||
12
layers/collection/1016.geojson
Normal file
12
layers/collection/1016.geojson
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"geometry": null,
|
||||
"properties": {
|
||||
"name": "4UMaps",
|
||||
"maxZoom": 15,
|
||||
"attribution": "Map data: © <a href=\"http://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a> contributors, under ODbL | Tiles: © <a href=\"http://www.4umaps.eu/\">4UMaps</a>",
|
||||
"id": "1016",
|
||||
"url": "http://4umaps.eu/{z}/{x}/{y}.png",
|
||||
"dataSource": "LayersCollection"
|
||||
},
|
||||
"type": "Feature"
|
||||
}
|
||||
14
layers/collection/1017.geojson
Normal file
14
layers/collection/1017.geojson
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"geometry": null,
|
||||
"properties": {
|
||||
"name": "Osmapa.pl",
|
||||
"maxZoom": 20,
|
||||
"attribution": "Map data: © <a href=\"http://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a> contributors, under ODbL | Tiles: © <a href=\"http://osmapa.pl/\" target=\"_blank\">Osmapa.pl</a>",
|
||||
"id": "1017",
|
||||
"threed": "true",
|
||||
"language": "pl",
|
||||
"url": "http://{s}.tile.openstreetmap.pl/osmapa.pl/{z}/{x}/{y}.png",
|
||||
"dataSource": "LayersCollection"
|
||||
},
|
||||
"type": "Feature"
|
||||
}
|
||||
14
layers/collection/1021.geojson
Normal file
14
layers/collection/1021.geojson
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"geometry": null,
|
||||
"properties": {
|
||||
"name": "Спутник",
|
||||
"maxZoom": 19,
|
||||
"attribution": "Map data: © <a href=\"http://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a> contributors, under ODbL | Tiles: © <a href=\"http://maps.sputnik.ru/\" target=\"_blank\">Спутник</a>",
|
||||
"id": "1021",
|
||||
"threed": "true",
|
||||
"language": "ru",
|
||||
"url": "http://{s}.tiles.maps.sputnik.ru/{z}/{x}/{y}.png",
|
||||
"dataSource": "LayersCollection"
|
||||
},
|
||||
"type": "Feature"
|
||||
}
|
||||
19
layers/collection/1023.geojson
Normal file
19
layers/collection/1023.geojson
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"geometry": null,
|
||||
"properties": {
|
||||
"name": "Космоснимки",
|
||||
"maxZoom": 18,
|
||||
"attribution": "Map data: © <a href=\"http://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a> contributors, under ODbL | Tiles: © <a href=\"http://osm.kosmosnimki.ru/\" target=\"_blank\">ScanEx</a>",
|
||||
"id": "1023",
|
||||
"subdomains": [
|
||||
"a",
|
||||
"b",
|
||||
"c",
|
||||
"d"
|
||||
],
|
||||
"language": "ru",
|
||||
"url": "http://{s}.tile.osm.kosmosnimki.ru/kosmo/{z}/{x}/{y}.png",
|
||||
"dataSource": "LayersCollection"
|
||||
},
|
||||
"type": "Feature"
|
||||
}
|
||||
12
layers/collection/1061.geojson
Normal file
12
layers/collection/1061.geojson
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"geometry": null,
|
||||
"properties": {
|
||||
"name": "Thunderforest Outdoors",
|
||||
"maxZoom": 22,
|
||||
"attribution": "Map data: © <a href=\"http://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a> contributors, under ODbL | Tiles: © <a href=\"http://www.thunderforest.com/\" target=\"_blank\">Andy Allan</a>",
|
||||
"id": "1061",
|
||||
"url": "http://{s}.tile.thunderforest.com/outdoors/{z}/{x}/{y}.png",
|
||||
"dataSource": "LayersCollection"
|
||||
},
|
||||
"type": "Feature"
|
||||
}
|
||||
12
layers/collection/1065.geojson
Normal file
12
layers/collection/1065.geojson
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"geometry": null,
|
||||
"properties": {
|
||||
"name": "Hike & Bike",
|
||||
"maxZoom": 19,
|
||||
"attribution": "Map data: © <a href=\"http://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a> contributors, under ODbL | Tiles: © <a href=\"http://hikebikemap.de/\" target=\"_blank\">Colin Marquardt</a>",
|
||||
"id": "1065",
|
||||
"url": "http://toolserver.org/tiles/hikebike/{z}/{x}/{y}.png",
|
||||
"dataSource": "LayersCollection"
|
||||
},
|
||||
"type": "Feature"
|
||||
}
|
||||
13
layers/collection/1069.geojson
Normal file
13
layers/collection/1069.geojson
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"geometry": null,
|
||||
"properties": {
|
||||
"name": "Refuges.info hiking",
|
||||
"maxZoom": 18,
|
||||
"attribution": "Map data: © <a href=\"http://www.openstreetmap.org/copyright\" target=\"_blank\">OpenStreetMap</a> contributors, under ODbL | Tiles: © <a href=\"http://maps.refuges.info/\" target=\"_blank\">sly</a>",
|
||||
"id": "1069",
|
||||
"old": "true",
|
||||
"url": "http://maps.refuges.info/hiking/{z}/{x}/{y}.png",
|
||||
"dataSource": "LayersCollection"
|
||||
},
|
||||
"type": "Feature"
|
||||
}
|
||||
52
layers/collection/extract.js
Normal file
52
layers/collection/extract.js
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
const fetch = require('node-fetch');
|
||||
|
||||
const outDir = __dirname;
|
||||
|
||||
var includeList = [
|
||||
"1016", // 4UMaps
|
||||
"1065", // Hike & Bike Map
|
||||
"1061", // Thunderforest Outdoors
|
||||
"1021", // kosmosnimki.ru
|
||||
"1017", // sputnik.ru
|
||||
"1023", // Osmapa.pl - Mapa OpenStreetMap Polska
|
||||
"1010", // OpenStreetMap.se (Hydda.Full)
|
||||
"1069" // MRI (maps.refuges.info)
|
||||
];
|
||||
|
||||
function extract(constantsJs) {
|
||||
eval(constantsJs);
|
||||
|
||||
for (let i = 0; i < includeList.length; i++) {
|
||||
let id = includeList[i];
|
||||
|
||||
let layer = getLayerDataByID(id);
|
||||
if (!layer) {
|
||||
console.warn('Layer not found: ' + id);
|
||||
continue;
|
||||
}
|
||||
//console.log(`${layer.id}, ${layer.name}, ${layer.address}`);
|
||||
|
||||
layer.url = layer.address;
|
||||
delete layer.address;
|
||||
|
||||
let geoJson = {
|
||||
geometry: null,
|
||||
properties: layer,
|
||||
type: "Feature"
|
||||
};
|
||||
geoJson.properties.dataSource = 'LayersCollection';
|
||||
|
||||
const outFileName = path.join(outDir, layer.id + '.geojson');
|
||||
const data = JSON.stringify(geoJson, null, 2);
|
||||
fs.writeFileSync(outFileName, data);
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/Edward17/LayersCollection/blob/gh-pages/constants.js
|
||||
fetch('http://edward17.github.io/LayersCollection/constants.js')
|
||||
.then(res => res.text())
|
||||
.then(text => extract(text))
|
||||
.catch(err => console.error(err));
|
||||
Loading…
Add table
Add a link
Reference in a new issue