forked from mapbox/geojson-fixtures
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
36 lines (25 loc) · 1.09 KB
/
index.js
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
var fs = require('fs');
module.exports.geometry = {};
var geoms = ['geometrycollection', 'polygon', 'point', 'multipoint', 'multipolygon',
'polygon', 'multilinestring'];
geoms.forEach(function(type) {
module.exports.geometry[type] = JSON.parse(fs.readFileSync(__dirname + '/data/geometry/' + type + '.geojson'));
});
geoms.forEach(function(type) {
module.exports.geometry[type+'-xyz'] = JSON.parse(fs.readFileSync(__dirname + '/data/geometry/' + type + '-xyz.geojson'));
});
module.exports.featurecollection = {};
['one'].forEach(function(name) {
module.exports.featurecollection[name] = JSON.parse(fs.readFileSync(__dirname + '/data/featurecollection/' + name + '.geojson'));
});
module.exports.feature = {};
['one'].forEach(function(name) {
module.exports.feature[name] = JSON.parse(fs.readFileSync(__dirname + '/data/feature/' + name + '.geojson'));
});
var all = {};
Object.keys(module.exports).forEach(function(o, i) {
Object.keys(module.exports[o]).forEach(function(k, j) {
all[k + '-' + i + '-' + j] = module.exports[o][k];
});
});
module.exports.all = all;