Skip to content

Commit

Permalink
feat: pick dem according to resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
robinbourianes-kalisio committed May 5, 2022
1 parent 13d8363 commit aae22cb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/elevation.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,16 @@ async function elevation(geojson) {

// 1 arc sec is ~30m at the equator
// srtmv4 is 3arcsec => ~90m
// gmted2010 has 7.5, 15 and 30 arcsec => ~220m
const demFile = path.join('/mbtiles', demOverride !== '' ? demOverride : resolution < 220 ? 'srtm.vrt' : 'gmted2010.vrt')
// gmted2010 has 7.5, 15 and 30 arcsec => ~250m, 500 & 1000m
let demFile = demOverride
if (demFile === '') {
// no override, pick dem according to requested resolution
if (resolution < 250) demFile = 'srtm.vrt'
else if (resolution < 500) demFile = 'GMTED2010/mx75.tif'
else if (resolution < 1000) demFile = 'GMTED2010/mx15.tif'
else demFile = 'GMTED2010/mx30.tif'
}
demFile = path.join('/mbtiles', demFile)

debug(`using ${demFile} concurrency ${concurrency}`)

Expand Down

0 comments on commit aae22cb

Please sign in to comment.