Skip to content

Is it possible to mask rendered mosaic tiles using a GeoJSON? #141

Answered by hrodmn
hrodmn asked this question in Q&A
Discussion options

You must be logged in to vote

@vincentsarago I worked out a solution for this! At first I tried a geojson approach but did not like how I had to pull the whole geojson for every single tile request. The vector features that I want to use as a mask are all accessible via tipg which makes it possible to use vector tile features that exactly match the raster tiles.

Performance is actually pretty good when running on my Lambda titiler-pgstac deployment (launched using eoapi-cdk fixtures).

Right now I am just setting areas not covered by the mask to zero, but ideally those would get transparent values in the rendered image.
I figured out how to apply the mask to the ImageData.array.mask to properly mask out pixels that are…

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by hrodmn
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #140 on November 09, 2023 23:44.