Sunteți pe pagina 1din 11

Spatial Analysis Scale Gianni Gorgoglione

1

Up-scaling Vegetation Cover Information
Mer Bleue Peatland with R

1.
Load the packages called raster and rgdal. The raster package facilitates the
reading, writing, manipulating, analyzing and modelling of raster data including
GIS overlays whereas, rgdal is a translator library for a large number of different
raster geospatial data formats.

install.packages("raster")
install.packages("rgdal")
library(raster)
library(sp)



2.

mb<-raster("C:/TempData/SCALE G/Mer_Bleue/mbveg2.rst")
What is its spatial resolution?
27.96537, 28.0067 (x,y)
What coordinate system does the object possess?
WGS84
How many rows and columns does the data set have?
Spatial Analysis Scale Gianni Gorgoglione


2

1524000 1526000 1528000 1530000
6
3
9
2
0
0
0
6
3
9
4
0
0
0
6
3
9
6
0
0
0
6
3
9
8
0
0
0
6
4
0
0
0
0
0
Vegetation Cover, Mer bleue
1
2
3
4
5
6
Figure 1 Vegetation cover, Mer Bleue - Test image plot with colors
ncols : int 341
nrows : int 181
3.
farg<-c('beige','forestgreen','yellowgreen','lightgreen','orange','red')
4.
plot(mb, main='Vegetation Cover, Mer bleue',col=farg)












Spatial Analysis Scale Gianni Gorgoglione


3

farg<-c('beige','forestgreen','yellowgreen','lightgreen','orange','brown')

Figure 2 Vegetation cover, Mer Bleue - Test image plot with appropriate colors
5.
Click(mb)
When you click with the mouse on the map it returns the object name as shown in the legend.
6.
Inspect the map visually.
What is the most frequently occurring class?
Class 2 forestgreen
What is the most infrequently occurring class?
Class 6 Tundra
Which class is most contiguous?
Class 2 and 3
Fragmented?
Class 6 looks more fragmented
1524000 1526000 1528000 1530000
6
3
9
2
0
0
0
6
3
9
4
0
0
0
6
3
9
6
0
0
0
6
3
9
8
0
0
0
6
4
0
0
0
0
0
Vegetation Cover, Mer bleue
1
2
3
4
5
6
Spatial Analysis Scale Gianni Gorgoglione


4

7.
How many cells does the object contain?
61721
How many cells does each land cover class contain?
Freq(mb)

Value count
[1,] 1 14218
[2,] 2 17396
[3,] 3 12403
[4,] 4 7595
[5,] 5 3686
[6,] 6 6423


8.
Compute the proportion of each cover type in the raster object and store these
proportions as a vector. For example, for 28m, the vector can be named
propmb1. Note that you should have 6 proportions in the vector, each
corresponding to a different land cover type.

propmb1<-read.table("C:/spatialanalysistemp/propmb1.txt",sep = "",dec=".")
Table 1 mb1 land cover
proportion
Class Proportion
%
1 23.03592
2 28.1849
3 20.09527
4 12.30537
5 5.972035
6 10.40651


9.
mb2<-aggregate(mb,factor=2,fun=modal)
Spatial Analysis Scale Gianni Gorgoglione


5

Aggregation creates a raster with a lower resolution. The algorithm groups cells to build a bigger new
one. The polygons are combined by aggregating the variables that have the same attribute. Aggregation
uses the modal function as computational method. Thus, in the case of a raster, it assigns the attribute
to the new cell value that had major frequency.
10.
plot(mb2, main='Vegetation Cover, MB2',col=farg)

Figure 3 mb2 vegetation cover

What is its spatial resolution?
55.93074, 56.0134 (x,y)
How many rows and columns does the data set have?
Nrow 91, ncol 171, 15561 no.cells
##Upscaling mb4 to mb32
1524000 1526000 1528000 1530000
6
3
9
2
0
0
0
6
3
9
4
0
0
0
6
3
9
6
0
0
0
6
3
9
8
0
0
0
6
4
0
0
0
0
0
Vegetation Cover, MB2
1
2
3
4
5
6
Spatial Analysis Scale Gianni Gorgoglione


6

1524000 1526000 1528000 1530000 1532000
6
3
9
2
0
0
0
6
3
9
4
0
0
0
6
3
9
6
0
0
0
6
3
9
8
0
0
0
6
4
0
0
0
0
0
Vegetation Cover, MB8
1
2
3
4
5
6
1524000 1526000 1528000 1530000 1532000
6
3
9
2
0
0
0
6
3
9
4
0
0
0
6
3
9
6
0
0
0
6
3
9
8
0
0
0
6
4
0
0
0
0
0
Vegetation Cover, MB16
1
2
3
4
5
6
1524000 1526000 1528000 1530000 1532000
6
3
9
2
0
0
0
6
3
9
4
0
0
0
6
3
9
6
0
0
0
6
3
9
8
0
0
0
6
4
0
0
0
0
0
Vegetation Cover, MB32
1
2
3
4
5
6
Figure 5 mb8 Vegetation Cover resolution mb4x2
Figure 6 mb16 Vegetation Cover resolution mb8x2
Figur 4 mb4 Vegetation Cover resolution mb2x2
Figure 7 mb32 Vegetation Cover resolution mb16x2
mb4<-aggregate(mb2,factor=2,fun=modal)
mb8<-aggregate(mb4,factor=2,fun=modal)
mb16<-aggregate(mb8,factor=2,fun=modal)
mb32<-aggregate(mb16,factor=2,fun=modal)
plot(mb4, main='Vegetation Cover, MB4',col=farg)
plot(mb8, main='Vegetation Cover, MB8',col=farg)
plot(mb16, main='Vegetation Cover, MB16',col=farg)
plot(mb32, main='Vegetation Cover, MB32',col=farg)










propmb4<-read.table("C:/spatialanalysistemp/propmb4.txt",sep = "",dec=".")
> propmb8<-read.table("C:/spatialanalysistemp/propmb8.txt",sep = "",dec=".")
> propmb16<-read.table("C:/spatialanalysistemp/propmb16.txt",sep = "",dec=".")
> propmb32<-read.table("C:/spatialanalysistemp/propmb32.txt",sep = "",dec=".")

1524000 1526000 1528000 1530000 1532000
6
3
9
2
0
0
0
6
3
9
4
0
0
0
6
3
9
6
0
0
0
6
3
9
8
0
0
0
6
4
0
0
0
0
0
Vegetation Cover, MB4
1
2
3
4
5
6
Spatial Analysis Scale Gianni Gorgoglione


7

Table 2 Number of cells and % for landcover resolution
mb2 mb4 mb8
1 3747 24,07943 1 1033 26,11223 1 266 26,89585
2 4481 28,79635 2 1166 29,47422 2 326 32,96259
3 3012 19,35608 3 734 18,5541 3 166 16,78463
4 1849 11,88227 4 432 10,92012 4 100 10,11122
5 920 5,912216 5 234 5,915066 5 60 6,066734
6 1552 9,973652 6 357 9,024267 6 71 7,178969
tot 15561 tot 3956 tot 989
mb16 mb32


1 80 30,30303 1 18 27,27273


2 87 32,95455 2 26 39,39394


3 37 14,01515 3 7 10,60606


4 28 10,60606 4 7 10,60606


5 16 6,060606 5 5 7,575758


6 16 6,060606 6 3 4,545455


tot 264 Tot 66




11.
landcover<-c("Other surfaces","Closed tree Canopy","Open tree canopy - tree cover","Open tree
canopy - Shrub and moss cover", "Peatland vegetation - Shrubs and mosses","Pseudo-Tundra
vegetation")
12. proportion<-data.frame(propmb1,propmb2,propmb4,propmb8,propmb16,propmb32)
> proportion

Nrows= represent the vegetation type
Ncol= represent the value in % of each raster with factors 4,8,16,32
13. rownames(proportion)<-landcover
colnames(proportion)<-
c("propmb1","propmb2","propmb4","propmb8","propmb16","propmb32")

Spatial Analysis Scale Gianni Gorgoglione


8

14/15. prop<-t(proportion)
The Data-frame has changed structure by inverting columns with rows position
Class(prop) transform our data frame into a matrix. The object created is prop as an
object_class. That is similar like the oriented object programming language where you define an
entity as object_class.

16. prop.df<-data.frame(prop)

17. plot(prop.df$"Other.surfaces",type="1",xlab="Resolution",ylab="Proportion",main="Proportion
vs. Resolution,Other Surfaces",xaxt="n")



18.
tics<-c(1,2,3,4,5,6)
res<-c("28m","56m","112m","224m","448m","896m")
axis(1,at=tics,labels=res)
0
2
0
4
0
6
0
8
0
1
0
0
Proportion vs. Resolution,Other Surfaces
Resolution
P
r
o
p
o
r
t
i
o
n
Spatial Analysis Scale Gianni Gorgoglione


9


At specifies the points at which tick-marks are to be drawn
Position of the axis in the plot. 1=below
Labels tell about the vector to use as labels

0
2
0
4
0
6
0
8
0
1
0
0
Proportion vs. Resolution,Other Surfaces
Resolution
P
r
o
p
o
r
t
i o
n
28m 56m 112m 224m 448m 896m
Spatial Analysis Scale Gianni Gorgoglione


10

19.


Spatial Analysis Scale Gianni Gorgoglione


11

20.

The up-scaling of the raster to a bigger grain size results, generally, as a loss of information. By
looking at figures 2 and 3, it is still possible distinguish boundaries of the land cover classes, a
large number of cells depicts well the land cover classes and proportions are not changed both
for mb1 and mb2 (see table 1 and 2). Then, mb8 raster has ready significant changes in
proportions and geometry. In fact, the 6
th
cover class in some area is disappeared and this is
visible even in the proportion change by 9% of mb4 to 7% of mb4. Despite this decreasing of
proportion for the land cover 6
th
, there is an increase of area for the 2
th
cover class from a 29.5 %
to a 33 % (See table 2).
The increase of resolution in mb4 figure (6) and mb8 (figure 7) show a completely loss of
information about boundaries of the land cover and the altered proportions. Some area has
shirked, some has expanded and finally some has disappeared completely. Besides in the figure 7
is no more recognizable the original shape of land covers.
Nevertheless, when looking at the proportions between the different resolution is still possible
notice that land covers maintain own proportion in a coarse way. Controversially, it still possible
assume that land cover classes does not change extremely. That is valid only if we does not take
into account the last up scaling of mb32 (figure 7).

Those land cover with a large area have a tendency in increase more during the up-scaling
process. In other land covers, instead, the amount of area shrink when scale increases. This might
indicate that when the mode method for aggregation is applied between contiguous land covers
these phenomena occur. Thus, cells with with more frequency determinate the new values of
neighbors cells of other land covers ones. In this case will not be respected the classification
criteria. For instance, in mb16 figure 6 it is possible to see that the increase of grain results as a
loss of rare categories like for instance category 6 (Tundra).
This tendency is more observable if we take a look to the graphs of the proportion in figure 8.
Those land covers with a higher frequency increased their cells quantity like for example the
Other surfaces and closed tree canopy land covers. The open tree canopy and tundra land covers
instead decreased in their frequency. Besides, that also suggests the fact that land covers cells
closer to each other tend to increase its own surface and vice versa those cells more dispersed
in patch tend to be excluded by the aggregation method as explained above.

S-ar putea să vă placă și