Hello Mega
On 12/29/20 1:51 AM, mega saputra wrote:
Hello guys,
I have tried to add (passive) scatter plot with my data, and it is succeed.
But, I want to add in interactive scatter plot, and not succeed. The message :
"Scatter plot cannot be added. Multiple of bands ranges <rgb.1@PERMANENT:65529 * rgb.1@PERMANENT:65529 = 4294049841 > is higher than maximum limit <16810000> "
Before the interactive scatterplot, can you clarify two questions?
Why are you trying to plot a band against itself (rgb.1, rgb.1 above) ? This will give you 12,000,000 rows where each row contains two identical values. So the scatterplot will be essentially a line along 45º.
Second, with rasters of about 3000x4000 you will get a huge number of points in the scatterplot. Would you consider to downscale to a lower resolution to make the resulting scatterplot more manageable?
Now some suggestions:
The range of reflectance values in your RGB image are up from 0 to 65528. But the possible X-Y values in the Long/lat location need to be between 0-90 maximum in order to display the scatterplot. So here's a way to rescale the reflectance values to display the scatterplot on the Map Display.
# ----------------------------------------------------------
# 1- Create new location based on the CRS of the input GeoTiff
# and import to grass
# ----------------------------------------------------------
grass -c rgb.tif /home/micha/GIS/grass/mega
r.import input=rgb.tif output=rgb --overwrite
# imports 5 bands
# Check univariate statistics of one of the bands
r.univar rgb.1
100%
total null and non-null cells: 11836384
total null cells: 0
Of the non-null cells:
----------------------
n: 11836384
minimum: 0
maximum: 65528
range: 65528
mean: 3982.64
mean of absolute values: 3982.64
standard deviation: 4159.48
variance: 1.73012e+07
variation coefficient: 104.44 %
sum: 47140019279
# Notice that the maximum value can be as high as 65528
# (maximum of unsigned short integer)
# ----------------------------------------------------------
# 2- In order to display the scatterplot in a Lon/Lat coordinate system
# the max value cannot be higher than 90 (maximum latitude)
# So create rescaled rasters that "squeeze" reflectance values to the range 0,90
# ----------------------------------------------------------
r.rescale input=rgb.1 output=rgb.1.rescale to=0,90 --o
r.rescale input=rgb.2 output=rgb.2.rescale to=0,90 --o
r.rescale input=rgb.3 output=rgb.3.rescale to=0,90 --o
r.rescale input=rgb.4 output=rgb.4.rescale to=0,90 --o
r.rescale input=rgb.5 output=rgb.5.rescale to=0,90 --o
# ----------------------------------------------------------
# 3- Now prepare the scatterplot vector using the rescaled rasters, and display
# 12 million points takes a while...
# Here I choose the red and NIR bands for the scatterplot
# ----------------------------------------------------------
r.scatterplot input=rgb.3.rescale,rgb.4.rescale out=scatter_3_4 --o
# See the attached image
HTH
So, how to add in interactive scatter plot?
My data in : https://1drv.ms/u/s!AjXAWS5maHffhyH0q9oTos1umy3D?e=bKa7mX
regards,
mega
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user
--
Micha Silver
Ben Gurion Univ.
Sde Boker, Remote Sensing Lab
cell: +972-523-665918
(attachments)
