


d1=load('brasil_landuse_ibge_2014_01_raster.mat');
d2=load('brasil_landuse_ibge_2014_002_raster.mat');

% Classes 

classes = {
'Continental Water Body'; 1,...
'Agricultural and pasture mix with forest remnants'; 2,...
'Fields with agricultural areas'; 3,...
'Forests with agricultural areas'; 4,...
'Natural Pasture'; 5,...
'Planted Pasture'; 6,...
'Silviculture'; 7,...
'Fields'; 8,...
'Forests'; 9,...
'Agriculture'; 10,...
'Artificial areas'; 11,...
'Bare soil'; 12,...
'Wet areas'; 13,...

% Divide classes into functional categories:
%
% Natura Areas 			- Greens 
% Agricultural Influenced Areas - Reds
% Cattle Areas 			- Yellows 
% Non-natural areas 		- Magentas
% Water 			- Blues 

CLS = {
'NO DATA',  	0, [0 0 0] ;
'WATER',1, [0 0 1] ;
'WET AREA',    13, [0 1 1] ; 
'FOREST',  	9, [0 .7 0] ;
'FIELD',  	8, [0 1 0] ;
'AGRICULT',    10, [1 0 0] ; %
'AGR+FLD',  	3, [.7 0 0] ; %
'AGR+FOR', 	4, [.5 0 0] ; %
'AGR.PA.FO',  2, [.5 .3 0] ; %
'SIVICULT',  	7, [.3 .3 0] ; %
'PAST NAT',  5, [1 .7 0] ;  %%
'PAST MMD', 6, [1 1 0] ;  %%
'ARTIFICIAL',  11, [1 0 1] ;  
'BARE SOIL',   12, [.7 0 1];
}; 

[~,ii] = sort([CLS{:,2}]);
COLORS = cat(1,CLS{ii,3});


figure;
imagesc([d1.box.lonmin d1.box.lonmax],[d1.box.latmin d1.box.latmax],d1.raster); axis xy

caxis([-.5 13.5]); colormap(COLORS);
cb=colorbar;
set(cb,'Ticks',[0:13]);
set(cb,'TickLabels',{CLS{ii,1}});

title('IBGE'' Land Use Map - 0.01 deg');
xlabel('Longitude');
ylabel('Latitude');


figure;
imagesc([d2.box.lonmin d2.box.lonmax],[d2.box.latmin d2.box.latmax],d2.raster); axis xy

caxis([-.5 13.5]); colormap(COLORS);
cb=colorbar;
set(cb,'Ticks',[0:13]);
set(cb,'TickLabels',{CLS{ii,1}});

title('IBGE'' Land Use Map - 0.002 deg');
xlabel('Longitude');
ylabel('Latitude');


