-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
23 lines (21 loc) · 952 Bytes
/
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
const {postgis2mbtiles} = require('@watergis/postgis2mbtiles');
const {postgis2geojson} = require('@watergis/postgis2geojson');
const config = require('./config');
const configSearch = require('./config-search');
const generate = async () =>{
console.time('postgis2mbtiles');
const pg2json = new postgis2geojson(configSearch);
const file_search = await pg2json.run();
console.log(`geojson file was generated: ${file_search}`);
const pg2mbtiles = new postgis2mbtiles(config);
const file_mbtile = await pg2mbtiles.run()
console.log(`mbtiles was generated: ${file_mbtile}`);
if (config.createPmtiles) {
config.mbtiles = config.mbtiles.replace('.mbtiles', '.pmtiles')
const pg2pmtiles = new postgis2mbtiles(config);
const file_pmtile = await pg2pmtiles.run()
console.log(`pmtiles was generated: ${file_pmtile}`);
}
console.timeEnd('postgis2mbtiles');
};
module.exports = generate();