Skip to content

Commit

Permalink
try special case for umbra data
Browse files Browse the repository at this point in the history
  • Loading branch information
scottyhq authored Jan 24, 2025
1 parent e1ee973 commit d1eed49
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,18 @@ module.exports = {
displayGeoTiffByDefault: false,
buildTileUrlTemplate: ({href, asset}) => {
let url = encodeURIComponent(asset.href.startsWith("/vsi") ? asset.href : href);
console.log(url)
console.log(asset)
// console.log(url)
// console.log(asset)
if (asset.href.endsWith('wrapped_phase.tif')) {
console.log('TITILER WRAPPED PHASE')
return "https://titiler.xyz/cog/tiles/WebMercatorQuad/{z}/{x}/{y}@2x?url={url}&rescale=-3.14,3.14&colormap_name=hsv";
}
else if (asset.href.endsWith('GEC.tif') || asset.href.endsWith('MM.tif')) {
console.log('UMBRA OPEN DATA')
// url encoding of spaces is strange. a workaround is to pass /vsicurl/ prefix
let gdalurl = ['/vsicurl/',url];
return "https://titiler.xyz/cog/tiles/WebMercatorQuad/{z}/{x}/{y}@2x?url={gdalurl}";
}
else {
console.log('TITLER DEFAULT')
return "https://titiler.xyz/cog/tiles/WebMercatorQuad/{z}/{x}/{y}@2x?url={url}";
Expand Down

0 comments on commit d1eed49

Please sign in to comment.