Closed orkunasa closed 4 years ago
Try different variable names for the bands. The key names r
, g
, b
are "reserved" for RGB mode, if the endpoint detects these exact names, it will try to interpret the data as RGB rendering mode. So try calling the layers a,b,c instead or something similar. Maybe this solves the problem.
For instance, the following could work:
Thanks for the answer @yellowcap
Unfortunately, It didn't work. I think there is a problem with result of the (red+green) operation. I handled this problem changing formula: (red-green)/(red+(green-blue))
My URL: http://127.0.0.1:8080/raster/algebra/{z}/{x}/{y}.png?layers=red:0=1,green:1=1,blue:2=1&alpha&formula=(red-green)/(red+(green-blue))&colormap={"continuous":true,"range":[-1,1], "to":[0,104,55], "from":[165,0,38], "over":[249,247,174]}'
The pixel values of the VARI image should be between [-1, 1]. But they are not. So same part of the image come transparent. Do you have any idea how can i scale the result?
Thank you.
I don't think that the VARI index is always between -1 and 1. If in your formula red = 100, green = 0, and blue = 50, the result is 2 right?
The raster formula rendering is transparent if the values fall outside of the range parameter that is indicated.
On a side note, the reference I found for this index used (green- red), your formula is (red - green).
https://www.harrisgeospatial.com/docs/BroadbandGreenness.html#Visible
You're right! Thank you for your help.
Hello,
When I applied VARI formula on the tails, returns 400 bad request error. How can i solve this problem? Min and max functions may solve this problem; however, they are not implemented right now.
VARI Formula: (Green - Red) / (Green + Red - Blue)
My Tile URL: http://127.0.0.1:8080/raster/algebra/{z}/{x}/{y}.png?layers=r:0=1,g:1=1,b:2=1&alpha&formula=(r-g)/(r+g-b)
Bands:
Thank you.