developmentseed / developmentseed/deck.gl-raster

deck.gl-geotiff: Use `boundless: true` when fetching COG tiles in `COGLayer`?

Open
#412 2 comments 0 reactions 0 assignees View on GitHub
cog
Dominant language
TypeScript
Stars
228
Forks
29
Avg merge
12h 27m
Merged PRs (30d)
4

Description

Currently we use `boundless: false` when fetching COG tiles:

https://github.com/developmentseed/deck.gl-raster/blob/72ca8aeae94fd9579995de06f89dba3023dd4072/packages/deck.gl-geotiff/src/geotiff/render-pipeline.ts#L157-L161

and then we use `clipToImageBounds` to clip _on CPU_ to the valid region of the image

https://github.com/developmentseed/deck.gl-raster/blob/47afad5f31659303526de86d3b9aed03f62a39d2/packages/geotiff/src/fetch.ts#L388-L456

I think we should probably (? maybe?) avoid image clipping on CPU and upload the raw tiles as-is. Then we can use existing nodata-masking or mask-array masking to discard these pixels from rendering.

The tradeoff is that using `boundless: true` and removing CPU clipping:

- Should be faster by having less CPU overhead
- Should use slightly more GPU memory for the regions of the texture that are known to be nodata

In the `MultiCOGLayer` we always use `boundless: true` because we need the `uvTransform` to be consistent across all tiles. This is what produced the warped screenshots in https://github.com/developmentseed/deck.gl-raster/pull/410, which was fixed in #411

image

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.