I have had land coverage map in TIF
format that presumably used to calculate an area-weighted yearly mean temperature for Germany. I downloaded this land coverage map data from here (direct download link of land coverage map for Europe). In particular, I intend to extract data of land/soil coverage for the city, agricultural area and vice-versa. In my first step, I imported this land coverage data with raster
package. Here is my R script down below:
library(raster)
library(R.utils)
library(maptools)
url = "https://cidportal.jrc.ec.europa.eu/ftp/jrc-opendata/LUISA/PrimaryOutput/Europe/REF-2014/JRC_LUISA_Input_Corine_land_cover_2006_r_ref_2014.zip"
download.file(url, basename(url))
gunzip(basename(url))
rname <- list.files(getwd(), "tif$")
land_cover = raster::brick("~/LUISA_CLC_land_coverage/clc06_r.tif")
so far I am able to import original land coverage map in RasterBrick
object in R. Note that original map was covered the whole europe, so I
have to crop the regions that I am only interested in. To do so, I used maptools
and raster
package for clipping the map. Here is the R script down below:
data(wrld_simpl)
germany <- wrld_simpl[wrld_simpl@data$NAME == "Germany",]
germany <- spTransform(germany, CRSobj = land_cover@crs)
germany_land <- crop(land_cover, germany)
However, I assume that this cropped land coverage map in RasterBrick
object better to be in grid shapefile
with very high degree resolution, but how is it doable? Any idea?
The main point of raising this question is I need to retrieve all data of land/soil coverage for the city, agricultural area, and match this information to respective Germany NUTS-s level shapefile (download link of Germany level 3 shapefile).
I really don't have a solid idea how to utilize the data in this land coverage map for the sake of calculating area-weighted yearly mean temperature. Perhaps, a possible approach could be to retrieve land/soil coverage for the city, agricultural area data, then find match from Germany NUTS-3 level shapefile.
Here is how to get Germany' NUTS-3 shapefile( R script how to get Germany' NUTS-3 regions' shapefile in R):
library(maptools)
library(rgdal)
library(R.utils)
url = "http://ec.europa.eu/eurostat/cache/GISCO/distribution/v2/nuts/download/ref-nuts-2013-03m.shp.zip"
download.file(url, basename(url))
gunzip(basename(url))
getwd()
setwd("~/ref-nuts-2013-03m.shp/")
list.files(pattern = 'NUTS_RG_03M_2013.*.shp$')
eu <- readOGR(dsn = getwd(), layer ="NUTS_RG_03M_2013_4326_LEVL_2")
Germany_NUTS3 <- eu[eu@data$CNTR_CODE == "DE",]
So using this Gernamny' NUTS-3 shapefile, Germany_NUTS3
, I want to extract all data of land/soil coverage for the city, agricultural area and vice-versa.
If such extraction of data from land coverage map in RasterBrick
, how can I make this happen in R? Is that doable? Any efficient workaround to get this done? Any idea?
raster
package'sextract
function). That could give you and idea about the distribution of landcover classes within each polygon. Further, you could get an estimate of area through methods like pixel counting, which directly relates to the raster's resolution ... but this is turning into a theoretical discussion, and SO isn't really the place for that. I suggest you read some literature and googling (e.g. land cover area estimate from land cover classification) – Val