[GRASS-user] Scatter plot cannot be added in interactive scatter plot

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> "

So, how to add in interactive scatter plot?

My data in : https://1drv.ms/u/s!AjXAWS5maHffhyH0q9oTos1umy3D?e=bKa7mX

regards,
mega

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)

mega_scatter.png

The answer for your question :

  1. I really input band1 for x axis and band3 for y axis. I don’t know the message tell rgb1*rgb1. May be it just gives information about dimension. You can see in screenshot-1.

  2. Actually I don’t want to downscale. Because the digital number will vague.

Btw I have tried and I rescale the data with recommendation of GRASS GIS. Recommendation limit is 4000000. So, I rescale to 2000.

(Thu Dec 31 13:02:58 2020)
r.rescale input=rgb.5 output=rgb.5.rescale to=0,1999 --o
Rescale rgb.5[0,65528] to rgb.5.rescale[0,1999]
(Thu Dec 31 13:02:59 2020) Command finished (0 sec)
(Thu Dec 31 13:03:09 2020)
r.rescale input=rgb.4 output=rgb.4.rescale to=0,1999 --o
Rescale rgb.4[0,65528] to rgb.4.rescale[0,1999]
(Thu Dec 31 13:03:10 2020) Command finished (0 sec)
(Thu Dec 31 13:03:20 2020)
r.rescale input=rgb.3 output=rgb.3.rescale to=0,1999 --o
Rescale rgb.3[0,65528] to rgb.3.rescale[0,1999]
(Thu Dec 31 13:03:21 2020) Command finished (0 sec)
(Thu Dec 31 13:03:41 2020)
r.rescale input=rgb.2 output=rgb.2.rescale to=0,1999 --o
Rescale rgb.2[0,65528] to rgb.2.rescale[0,1999]
(Thu Dec 31 13:03:42 2020) Command finished (0 sec)
(Thu Dec 31 13:03:54 2020)
r.rescale input=rgb.1 output=rgb.1.rescale to=0,1999 --o
Rescale rgb.1[0,65528] to rgb.1.rescale[0,1999]
(Thu Dec 31 13:03:55 2020) Command finished (0 sec

Then I group the result with command i.group.

Then, from menu Imagery > Classify image > Interactive input for supervised classification. Then I succeed to create interactive scatter plot (screenshot-2).

In this window I can create polygon in scatter plot, but no effect with the raster like in https://grass.osgeo.org/grass78/manuals/wxGUI.iscatt.html. May be I will ask in new topic in new email.

Thank you.

On Tue, Dec 29, 2020 at 6:49 PM Micha Silver <tsvibar@gmail.com> wrote:

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
<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)

Screenshot-1.png
Screenshot2.png