How to get the min / max value to rescale using a mosaicJSON for dem COGs #701
-
Hello, I am trying to use titiler with the elevation dataset Copernicus DEM : https://registry.opendata.aws/copernicus-dem/ I have produced a Mosaic JSON using Then I use titiler to get tiles from it , for example: https://titiler.xyz/mosaicjson/tiles/12/1535/2322.png?url=https://filedn.com/lkrqWbAQYllSVUK4ip6g3m0/mosaic.json But I get a grey tile If I use some rescale But my issue is that I do not know what is the min, max to specify , is it the min max of the whole dataset ? or the min max of the bunch of COG files used by the mosaic for this tile ? For example for a single COG I can get the min/max info like this: https://titiler.xyz/cog/statistics?url=https://copernicus-dem-30m.s3.amazonaws.com/Copernicus_DSM_COG_10_N08_00_W068_00_DEM/Copernicus_DSM_COG_10_N08_00_W068_00_DEM.tif My question would be, what is the best way to set the rescale= parameter in case of a mosaic ? Thanks a lot Thibault |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
When using the rescaling parameter, this should be the min/max values for the whole dataset. ☝️ tiles will start loading at zoom 8 Note: we've added Copernicus DEM to rio-tiler-pds which in theory remove the need of creating MosaicJSON for this dataset. from rio_tiler_pds.copernicus.aws.dem import Dem30Reader
from titiler.core.factory import TilerFactory
# We need to overwrite the default `url` path parameter
def path_dep() -> str:
return "copernicus_dem"
from fastapi import FastAPI
app = FastAPI()
endpoints = TileFactory(
reader=Dem30Reader,
path_dependency=path_dep
)
app.include_router(endpoints.router) |
Beta Was this translation helpful? Give feedback.
-
Thanks ! Yes in the meantime I figured out that, I have set to 0,8900 I should be fine 😅
Ahh good to know, I will have a look. anyways it was a good exercise to generate a mosaic json myself, will be useful for future needs. Thanks a lot ! |
Beta Was this translation helpful? Give feedback.
When using the rescaling parameter, this should be the min/max values for the whole dataset.
https://titiler.xyz/mosaicjson/map?url=https://filedn.com/lkrqWbAQYllSVUK4ip6g3m0/mosaic.json&rescale=0,6000&colormap_name=terrain
☝️ tiles will start loading at zoom 8
Note: we've added Copernicus DEM to rio-tiler-pds which in theory remove the need of creating MosaicJSON for this dataset.