Skip to content

Commit

Permalink
support nodata parameter for tiling (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Varner authored Apr 10, 2024
1 parent 08c20c8 commit 4dc895c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Added

- Added initial console log of application deploy version number read from `package.json`
- Add support for `nodata` to tiling configurations.

## 5.0.2 - 2024-03-06

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ The configurations include:
image to composite.
- `colormap_name`: the colormap to use for mapping values (typically used for single band)
- `rescale`: the rescale range to apply prior to color mapping (typically used for single band)
- `nodata`: the nodata value to use, if not in image metadata

### Mosaic Tiling Configuration

Expand Down
10 changes: 10 additions & 0 deletions src/utils/mapHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,9 @@ const constructSceneTilerParams = (collection) => {
const assetBidx = parameters.bidx(tilerParams, collection, asset)
if (assetBidx) params.push(assetBidx)

const nodata = parameters.nodata(tilerParams, collection)
if (nodata) params.push(nodata)

const colorFormula = parameters.colorFormula(tilerParams, collection)
if (colorFormula) params.push(colorFormula)

Expand Down Expand Up @@ -481,6 +484,10 @@ const constructSceneAssetsParam = (collection, tilerParams) => {
}

const parameters = {
nodata: (tilerParams, collection) => {
const value = tilerParams[collection]?.nodata
return value == null ? null : `nodata=${value}`
},
colorFormula: (tilerParams, collection) => {
const value = tilerParams[collection]?.color_formula
return value && `color_formula=${value}`
Expand Down Expand Up @@ -540,6 +547,9 @@ export const constructMosaicTilerParams = (collection) => {
const bidx = parameters.bidx(tilerParams, collection)
if (bidx) params.push(bidx)

const nodata = parameters.nodata(tilerParams, collection)
if (nodata) params.push(nodata)

const colorFormula = parameters.colorFormula(tilerParams, collection)
if (colorFormula) params.push(colorFormula)

Expand Down

0 comments on commit 4dc895c

Please sign in to comment.