Closed winsento closed 6 years ago
did you try to display the data of each band? Try layers=x=5&formula=x
, and layers=x:1=5&formula=x
that should display a grayscale image of the first two bands. If that does not show anything, it is likely a data issue (i.e. you are looking at an empty tile, or tiles are not ingested properly)
All request from this list
layers=x=5&formula=x
layers=x:0=5&formula=x
layers=x:1=5&formula=x
show image in grayscale.
But layers=x:0=5,y:1=5&formula=x-y
return blank transparented file.
sorry, i think problem in data. Looks like bands is similar.
Band 1 Block=8021x1 Type=Byte, ColorInterp=Gray
Minimum=42.000, Maximum=255.000, Mean=125.312, StdDev=62.974
Metadata:
STATISTICS_MAXIMUM=255
STATISTICS_MEAN=125.31222374066
STATISTICS_MINIMUM=42
STATISTICS_STDDEV=62.973673414911
Band 2 Block=8021x1 Type=Byte, ColorInterp=Undefined
Minimum=42.000, Maximum=255.000, Mean=125.312, StdDev=62.974
Metadata:
STATISTICS_MAXIMUM=255
STATISTICS_MEAN=125.31222374066
STATISTICS_MINIMUM=42
STATISTICS_STDDEV=62.973673414911
Issue can be closed.
@yellowcap The question is now different.
Im upload 2 bands (geotif) from Landsat 8. And apply formula
layers=nir:0=7,red:0=8&formula=(nir-red)/(nir+red)
The result is displayed, but how can I assume the value of the pixel (result) is not in the range -1...1
how it should be.
Because if you apply a style, the following picture is shown:
colormap={ "x>3500":"%23FF0000"}
When everything is decided, I will create pull request with example to the documentation.
For ndvi, a continuous color scheme is more appropriate (unless you want explicit class breaks of course). The continuous legend option is explained in the docs:
https://django-raster.readthedocs.io/en/stable/tms.html#continuous-color-schemes
For ndvi, can you try the following (red-yellow-green color scheme, range from -1 to 1):
query_param | value |
---|---|
colormap | {"continuous":true,"range":[-1,1],"from":[165,0,38],"to":[0,104,55],"over":[249,247,174]} |
formula | (B8-B4)/(B8+B4) |
Remember you have to ensure that the url is correctly encoded so that the url is valid.
Still ndvi calculation should not return values out of the -1, 1 range. I think that this is due a division problem when the pixel values are too small and GDAL get confused. Maybe applying a threshold to the bands will help in this case, if not you can always scale down the image to -1, 1 as the ndvi is just a relation and is not meant to express a concrete value.
I have GeoTIFF with 2-bands from Landsat 8. Im try to generate NDVI via raster algebra.
GET parameters for layer and formula like this:
But
(nir-red)
- return empty raster tile.Raster here: LC08_L1TP_177024_20170922_20170922_01_RT.TIF.zip