-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathconfig.mjs
119 lines (116 loc) · 3.5 KB
/
config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
const config = {
resolutions: [50, 110],
scopes: [
{
name: 'africa',
specs: {
filter: 'georeg === "AFR"',
bounds: [-30, -50, 60, 50]
}
},
{
name: 'antarctica',
specs: {
filter: 'georeg === "ANT"',
bounds: [-180, -90, 180, -50]
}
},
{
name: 'asia',
specs: {
filter: 'georeg === "ASI"',
bounds: [15, -90, 180, 85]
}
},
{
name: 'europe',
specs: {
filter: 'georeg === "EUR"',
bounds: [-30, 0, 60, 90]
}
},
{
name: 'north-america',
specs: {
filter: 'subreg === "Northern America" || ["Central America", "Caribbean"].includes(intreg)',
bounds: [-180, 0, -45, 85]
}
},
{
name: 'oceania',
specs: {
filter: 'georeg === "OCE"',
bounds: [-180, -50, 180, 25]
}
},
{
name: 'south-america',
specs: {
filter: 'intreg === "South America"',
bounds: [-100, -70, -30, 25]
}
},
{
name: 'usa',
specs: {
filter: 'iso3cd === "USA" && ![4, undefined].includes(stscod)',
bounds: [-180, 0, -45, 85]
}
},
{
name: 'world',
specs: {
filter: '',
bounds: []
}
}
],
outputDirGeojson: './build/geodata/geojson',
outputDirTopojson: './dist/topojson',
inputDir: './build/geodata',
vectors: {
// 'coastlines', 'countries', 'land', and 'ocean' are derived from UN geodata
lakes: {
source: 'lakes',
type: 'physical'
},
rivers: {
source: 'rivers_lake_centerlines',
type: 'physical'
},
subunits: {
source: 'admin_1_states_provinces_lakes',
type: 'cultural'
}
},
layers: {
coastlines: 'land',
countries: 'countries',
ocean: 'land',
lakes: 'lakes',
land: 'land',
rivers: 'rivers_lake_centerlines',
subunits: 'admin_1_states_provinces_lakes'
},
unFilename: 'un_geodata_simplified',
unDownloadUrl: 'https://geoportal.un.org/arcgis/sharing/rest/content/items/d7caaff3ef4b4f7c82689b7c4694ad92/data',
filters: {
countries: 'stscod !== undefined',
land: [
'{839C9589-44D9-4BD5-A681-13E10ED03C5E}', // AME
'{2EE1B4A5-9C3F-445C-A1AB-399715463785}', // ANT
'{3D11547B-94D9-42C9-B849-14B389FE5F7F}', // OCE
'{32DB79BE-0D53-46BD-995F-EBE7C30ED6B6}', // AFR
'{3F3547E7-C7FB-4347-9D80-575C6485FD2E}', // EUR
'{4351AA38-B383-44BF-8341-720DD74872B4}' // ASI
]
.map((id) => `globalid === "${id}"`)
.join(' || '),
subunits: ['AUS', 'BRA', 'CAN', 'USA'].map((id) => `adm0_a3 === "${id}"`).join(' || ')
}
};
export const getNEFilename = ({ resolution, source }) => `ne_${resolution}m_${source}`;
export function getNEDownloadUrl({ resolution, vector: { source, type } }) {
return `https://naciscdn.org/naturalearth/${resolution}m/${type}/${getNEFilename({ resolution, source })}.zip`;
}
export default config;