diff --git a/gulp/maps/countries-coastline.js b/gulp/maps/countries-coastline.js index 5d3a712..2385b70 100644 --- a/gulp/maps/countries-coastline.js +++ b/gulp/maps/countries-coastline.js @@ -12,13 +12,13 @@ const utils = require('../utils'); * the countries coastline boundaries in a single file. */ gulp.task('countries-coastline-generate', async () => { - const coastlinePath = path.join(folders.mapsDir, 'countries-coastline.geo.json'); - const maritimePath = path.join(folders.mapsDir, 'countries-maritime.geo.json'); - const coastlinesPath = path.join(folders.mapsDir, 'earth-coastlines.geo.json'); + const coastlinePath = path.join(folders.mapsDir, 'countries-coastline.shp'); + const maritimePath = path.join(folders.mapsDir, 'countries-maritime.shp'); + const coastlinesPath = path.join(folders.mapsDir, 'earth-coastlines.shp'); const cmd = '-i ' + maritimePath + ' ' + '-clip ' + coastlinesPath + ' ' + - '-o precision=0.000001 format=geojson ' + coastlinePath + ' ' + + '-o format=shapefile ' + coastlinePath + ' ' + '-verbose'; await utils.mapshaperCmd(cmd); }); diff --git a/gulp/maps/countries-land.js b/gulp/maps/countries-land.js index 9ce8831..58bea41 100644 --- a/gulp/maps/countries-land.js +++ b/gulp/maps/countries-land.js @@ -12,13 +12,13 @@ const utils = require('../utils'); * the countries coastline boundaries in a single file. */ gulp.task('countries-land-generate', async () => { - const landPath = path.join(folders.mapsDir, 'countries-land.geo.json'); - const maritimePath = path.join(folders.mapsDir, 'countries-maritime.geo.json'); - const landsPath = path.join(folders.mapsDir, 'earth-lands.geo.json'); + const landPath = path.join(folders.mapsDir, 'countries-land.shp'); + const maritimePath = path.join(folders.mapsDir, 'countries-maritime.shp'); + const landsPath = path.join(folders.mapsDir, 'earth-lands.shp'); const cmd = '-i ' + maritimePath + ' ' + '-clip ' + landsPath + ' ' + - '-o precision=0.000001 format=geojson ' + landPath + ' ' + + '-o format=shapefile ' + landPath + ' ' + '-verbose'; await utils.mapshaperCmd(cmd); }); diff --git a/gulp/maps/countries-maritime.js b/gulp/maps/countries-maritime.js index 9666a96..8e78fa2 100644 --- a/gulp/maps/countries-maritime.js +++ b/gulp/maps/countries-maritime.js @@ -13,7 +13,7 @@ const utils = require('../utils'); * the countries maritime boundaries in a single file. */ gulp.task('countries-maritime-generate', async () => { - const maritimePath = path.join(folders.mapsDir, 'countries-maritime.geo.json'); + const maritimePath = path.join(folders.mapsDir, 'countries-maritime.shp'); const mapPath = path.join(folders.tmpDir, 'countries-map.json'); const tmpMaritimePath = path.join(folders.tmpDir, 'countries-maritime.geo.json'); @@ -31,7 +31,7 @@ gulp.task('countries-maritime-generate', async () => { await fs.outputJson(tmpMaritimePath, maritime); const cmd = '-i ' + tmpMaritimePath + ' ' + - '-o precision=0.000001 format=geojson ' + maritimePath + ' ' + - '-verbose'; + '-o format=shapefile ' + maritimePath + ' ' + + '-verbose'; await utils.mapshaperCmd(cmd); }); diff --git a/gulp/maps/earth-coastlines.js b/gulp/maps/earth-coastlines.js index 85eff8a..b76ea55 100644 --- a/gulp/maps/earth-coastlines.js +++ b/gulp/maps/earth-coastlines.js @@ -13,17 +13,16 @@ const utils = require('../utils'); * Creates a valid GeoJSON file from the OSM lakes map in the tmp folder. */ gulp.task('earth-coastlines-generate', async () => { - const landUrl = 'http://data.openstreetmapdata.com/simplified-land-polygons-complete-3857.zip'; + const landUrl = 'http://data.openstreetmapdata.com/land-polygons-complete-3857.zip'; + const coastlinesPath = path.join(folders.mapsDir, 'earth-coastlines.shp'); + const tmpCoastlinesDir = path.join(folders.tmpDir, 'earth-coastlines'); - const coastlinesPath = path.join(folders.mapsDir, 'earth-coastlines.geo.json'); - const tmpCoastlinesDir = path.join(folders.tmpDir, 'earth-coeastlines'); - - const shpLandPath = path.join(tmpCoastlinesDir, 'simplified_land_polygons.shp'); + const shpLandPath = path.join(tmpCoastlinesDir, 'land_polygons.shp'); const dwnOpts = { extract: true, strip: 1, - filter: file => file.path.indexOf('simplified_land_polygons') !== -1 + filter: file => file.path.indexOf('land_polygons') !== -1 }; await download(landUrl, tmpCoastlinesDir, dwnOpts).on('response', utils.downloadProgress('earth-coastlines')); @@ -31,7 +30,7 @@ gulp.task('earth-coastlines-generate', async () => { '-filter-fields ' + '-proj +init=epsg:4326 ' + '-dissolve ' + - '-o precision=0.000001 format=geojson ' + coastlinesPath + ' ' + + '-o format=shapefile ' + coastlinesPath + ' ' + '-verbose'; await utils.mapshaperCmd(cmd); diff --git a/gulp/maps/earth-lakes.js b/gulp/maps/earth-lakes.js index 9b1bd95..085a5b6 100644 --- a/gulp/maps/earth-lakes.js +++ b/gulp/maps/earth-lakes.js @@ -15,10 +15,10 @@ const utils = require('../utils'); gulp.task('earth-lakes-generate', async () => { const lakesUrl = 'http://data.openstreetmapdata.com/lakes-polygons-reduced-3857.zip'; - const lakesPath = path.join(folders.mapsDir, 'earth-lakes.geo.json'); + const lakesPath = path.join(folders.mapsDir, 'earth-lakes.shp'); const tmpLakesDir = path.join(folders.tmpDir, 'earth-lakes'); - const shpLakesPath = path.join(tmpLakesDir, 'lakes_reduced_z5.shp'); + const shpLakesPath = path.join(tmpLakesDir, 'lakes_reduced_z6.shp'); const dwnOpts = { extract: true, @@ -31,7 +31,7 @@ gulp.task('earth-lakes-generate', async () => { '-filter-fields ' + '-proj +init=epsg:4326 ' + '-dissolve ' + - '-o precision=0.000001 format=geojson ' + lakesPath + ' ' + + '-o format=shapefile ' + lakesPath + ' ' + '-verbose'; await utils.mapshaperCmd(cmd); diff --git a/gulp/maps/earth-lands.js b/gulp/maps/earth-lands.js index c2639db..e439612 100644 --- a/gulp/maps/earth-lands.js +++ b/gulp/maps/earth-lands.js @@ -11,15 +11,15 @@ const utils = require('../utils'); * Creates a valid GeoJSON file from the OSM lakes map in the tmp folder. */ gulp.task('earth-lands-generate', async () => { - const landsPath = path.join(folders.mapsDir, 'earth-lands.geo.json'); - const coastlinesPath = path.join(folders.mapsDir, 'earth-coastlines.geo.json'); - const lakesPath = path.join(folders.mapsDir, 'earth-lakes.geo.json'); - const riversPath = path.join(folders.mapsDir, 'earth-rivers.geo.json'); + const landsPath = path.join(folders.mapsDir, 'earth-lands.shp'); + const coastlinesPath = path.join(folders.mapsDir, 'earth-coastlines.shp'); + const lakesPath = path.join(folders.mapsDir, 'earth-lakes.shp'); + const riversPath = path.join(folders.mapsDir, 'earth-rivers.shp'); const cmd = '-i ' + coastlinesPath + ' ' + '-erase ' + lakesPath + ' target=1 ' + '-erase ' + riversPath + ' target=1 ' + - '-o precision=0.000001 format=geojson ' + landsPath + ' ' + + '-o format=shapefile ' + landsPath + ' ' + '-verbose'; await utils.mapshaperCmd(cmd); }); diff --git a/gulp/maps/earth-rivers.js b/gulp/maps/earth-rivers.js index c0f15e4..36d4bf4 100644 --- a/gulp/maps/earth-rivers.js +++ b/gulp/maps/earth-rivers.js @@ -15,7 +15,7 @@ const utils = require('../utils'); gulp.task('earth-rivers-generate', async () => { const riversUrl = 'http://data.openstreetmapdata.com/river-polygons-reduced-3857.zip'; - const riversPath = path.join(folders.mapsDir, 'earth-rivers.geo.json'); + const riversPath = path.join(folders.mapsDir, 'earth-rivers.shp'); const tmpRiversDir = path.join(folders.tmpDir, 'earth-rivers'); const shpRiversPath = path.join(tmpRiversDir, 'river_reduced_z6.shp'); @@ -31,7 +31,7 @@ gulp.task('earth-rivers-generate', async () => { '-filter-fields ' + '-proj +init=epsg:4326 ' + '-dissolve ' + - '-o precision=0.000001 format=geojson ' + riversPath + ' ' + + '-o format=shapefile ' + riversPath + ' ' + '-verbose'; await utils.mapshaperCmd(cmd); diff --git a/gulp/maps/earth-seas.js b/gulp/maps/earth-seas.js index 11a2d0b..891ef5e 100644 --- a/gulp/maps/earth-seas.js +++ b/gulp/maps/earth-seas.js @@ -11,15 +11,15 @@ const utils = require('../utils'); * Creates a valid GeoJSON file from the OSM lakes map in the tmp folder. */ gulp.task('earth-seas-generate', async () => { - const coastlinesPath = path.join(folders.mapsDir, 'earth-coastlines.geo.json'); - const seasPath = path.join(folders.mapsDir, 'earth-seas.geo.json'); + const coastlinesPath = path.join(folders.mapsDir, 'earth-coastlines.shp'); + const seasPath = path.join(folders.mapsDir, 'earth-seas.shp'); const cmd = '-rectangle bbox=-180,-90,180,90 name="bounds" ' + '-rectangle bbox=-180,-90,180,-80 name="south-pole-fix" ' + '-erase 2 target=1 ' + '-drop target=2 ' + '-erase ' + coastlinesPath + ' target=1 ' + - '-o precision=0.000001 format=geojson ' + seasPath + ' ' + + '-o format=shapefile ' + seasPath + ' ' + '-verbose'; await utils.mapshaperCmd(cmd); }); diff --git a/gulp/maps/earth-waterbodies.js b/gulp/maps/earth-waterbodies.js index 0b283c7..cdb463c 100644 --- a/gulp/maps/earth-waterbodies.js +++ b/gulp/maps/earth-waterbodies.js @@ -11,14 +11,14 @@ const utils = require('../utils'); * Creates a valid GeoJSON file from the OSM lakes map in the tmp folder. */ gulp.task('earth-waterbodies-generate', async () => { - const watersPath = path.join(folders.mapsDir, 'earth-waterbodies.geo.json'); - const lakesPath = path.join(folders.mapsDir, 'earth-lakes.geo.json'); - const riversPath = path.join(folders.mapsDir, 'earth-rivers.geo.json'); - const seasPath = path.join(folders.mapsDir, 'earth-seas.geo.json'); + const watersPath = path.join(folders.mapsDir, 'earth-waterbodies.shp'); + const lakesPath = path.join(folders.mapsDir, 'earth-lakes.shp'); + const riversPath = path.join(folders.mapsDir, 'earth-rivers.shp'); + const seasPath = path.join(folders.mapsDir, 'earth-seas.shp'); const cmd = '-i combine-files ' + riversPath + ' ' + lakesPath + ' ' + seasPath + ' ' + '-merge-layers ' + - '-o precision=0.000001 format=geojson ' + watersPath + ' ' + + '-o format=shapefile ' + watersPath + ' ' + '-verbose'; await utils.mapshaperCmd(cmd); }); diff --git a/gulp/tasks/compress.js b/gulp/tasks/compress.js index 9e4920f..a770891 100644 --- a/gulp/tasks/compress.js +++ b/gulp/tasks/compress.js @@ -22,7 +22,7 @@ gulp.task('compress', async () => { const bar = utils.processProgress(map, Object.keys(sizes).length); for (const size of Object.keys(sizes)) { - const mapPath = path.join(folders.mapsDir, map + '.geo.json'); + const mapPath = path.join(folders.mapsDir, map + '.shp'); const outMapDir = path.join(folders.buildDir, map, size); const outMapPath = path.join(outMapDir, 'map.geo.json');