rescale - what is it doing? #494
-
HI Guys , Hopefully this isnt a daft question but i am trying to understand what Titiler is doing so i dont make a mistake. I have a COG data ser of Wind speed and it is in Float32 . In order to display this correctly i need to use the rescale function . However , i was hoping someone could confirm my understanding is correct . My data set ranges from 4.9m/s - 16.4m/s , when I use rescale am i correct in assuming that the data range min - max is split between 0-255 ? i.e. 0 represents 4.9m/s and 255 represents 16.4m/s ? if the above is correct, is its possible to set the colormap such that the anything above say 10m/s is at the top of the colour scale ? I.e. from a wind energy perspective 16m/s is an extreme and i don't want my colour map scaled according to this outlier . code for my get request is below.
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Rescale is doing a linear stretch, the
This is correct if you don't specify the |
Beta Was this translation helpful? Give feedback.
-
thanks @geospatial-jeff 🙏 @mdavid80, as Jeff mentioned you can either use |
Beta Was this translation helpful? Give feedback.
Rescale is doing a linear stretch, the
minv
andmaxv
parameters in your GET request determine the input range for this stretch while the output range will always be 0-255 (8bit). It's ultimately calling this function in rio-tiler (note the call tonumpy.clip
).This is correct if you don't specify the
rescale
query parameter, in which case titiler falls back to scaling your data based on it's min/max range. If you wanted to cut off the histogram at 10m/s to remove outliers you could set therescale