Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Non-transparent rendering of a raster outside the bounding box #1092

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

Hi,
I'm struggling while trying to understand why titiler renders a non-transparent background outside the bounding box, while it's correctly rendered as transparent inside the bounding box.
image
In particular the URL I'm using is: /cog/tilejson.json?colormap_name=ylorrd&rescale=-1,15&bidx=1&minzoom=0&url=PATH_TO_COG

The raster dataset has a NODATA value set to -128

The response is:

{
 "tilejson":"2.2.0",
 "version":"1.0.0",
 "scheme":"xyz",
 "tiles":[
 "https://SERVER/cog/tiles/WebMercatorQuad/{z}/{x}/{y}@1x?colormap_name=ylorrd&rescale=-1%2C15&bidx=1&url=PATH_TO_COG"
 ],
 "minzoom":0,
 "maxzoom":12,
 "bounds":[
 10.546875000000014,
 59.7563950493563,
 10.986328125000014,
 60.02095215374802
 ],
 "center":[
 10.766601562500014,
 59.888673601552156,
 0
 ]
}

I checked the bounds and they are correct. I also tried to specify nodata=-128 as parameter, but the result didn't change...

Has anyone had the same issue?
Thank you!
Niccolò

You must be logged in to vote

I was using 0.17.0 and it seems that in 0.21.1 it's fixed 👍

Replies: 1 comment 4 replies

Comment options

pretty hard to tell without having access to the COG itself. Might be also useful to know which version of titiler/rio-tiler you're running.

If you can't change the cog as is you can checkout https://github.com/cogeotiff/rio-faux

You must be logged in to vote
4 replies
Comment options

I was using 0.17.0 and it seems that in 0.21.1 it's fixed 👍

Answer selected by vincentsarago
Comment options

I'm not sure it's the right place, but I was wondering how to render a transparent tile when it is outside the bounds, instead of the server throwing TileOutsideBounds?

Comment options

normally TileOutsideBounds should return a 404 (https://github.com/developmentseed/titiler/blob/main/src/titiler/core/titiler/core/errors.py#L35)

I'm not sure what you mean with render

Comment options

Yes I could see 404 on these tiles but for some reason they didn't appear as transparent. Anyway that's solved now, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /