User Tools

Site Tools


wikistudholland:utwente_vladimir

Comparing frequency distributions of bioclimatic environmental variables in Norway and Sweden

Name? Affiliation?

INTRODUCTION

Distribution of many insect species in Norway is poorly known, particularly in comparison to adjacent countries, e.g. Sweden. Many species are represented in Norwegian collections by very few specimens originating from a small number of localities close to where their collectors live(d). To some extent, the problem of lack of data about detailed distribution of a species in Norway can be mitigated by modelling the distribution of that species using the few records already available. An alternative approach could be to use projective modelling. A model of the species distribution can be trained using a dataset from the region where the distribution of the species is known well (e.g. Sweden) and then projected on the region where the distribution of the species is known poorly (i.e. Norway). Of course, this approach may work well only if the two regions, the one used to train the model, and the one used to project the model on, are similar in their environmental conditions. In my project I would like to assess the overlap in environmental conditions between Norway and Sweden.

General framework of the analysis

Background. In my exercise project I would like to compare how significant the overlap between the environmental conditions in Sweden and Norway is, and which parts of Norway fall within the range of environmental conditions that are present in Sweden. Based on that comparison between the environmental space of Sweden and Norway, I would like to identify the parts of Norway where species distribution can be predicted based on the models trained on Swedish data.

Keywords: Worldclim data, bioclimatic variables, species distribution modelling, environmental space.

Project objectives

Compare frequency distribution for bioclimatic environmental variables in Norway and Sweden.

METADATA

Vector data

Gridded Population of the World (GPW), v3 http://sedac.ciesin.columbia.edu/data/collection/gpw-v3. National Administrative boundaries.

Raster data

WorldClim dataset http://www.worldclim.org/.

Other data sources

None.

METHOD

1) I downloaded the needed parts of the WorldClim datasets (at 30“ resolution; tiles 06, 07 and 16 cover Norway, and tiles 06 and 16 cover Sweden) in GeoTIFF format from http://www.worldclim.org/tiles.php. I saved the data in the catalogue /home/user/Myproject/Bioclimdata/ as bioAABB.tif, where AA is the bioclim variable number, BB is the tile number, e.g. bio1206.tif.

2) I checked the projection of bioAA_BB.tif (all files should have the same projection):

gdalinfo /home/user/My_project/Bioclim_data/bio12_06.tif

I got the following:

Driver: GTiff/GeoTIFF
Files: /home/user/My_project/Bioclim_data/bio12_06.tif
       /home/user/My_project/Bioclim_data/bio12_06.tif.aux.xml
Size is 3600, 3600
Coordinate System is:
GEOGCS["WGS 84",
    DATUM["WGS_1984",
        SPHEROID["WGS 84",6378137,298.257223563,
            AUTHORITY["EPSG","7030"]],
        AUTHORITY["EPSG","6326"]],
    PRIMEM["Greenwich",0],
    UNIT["degree",0.0174532925199433],
    AUTHORITY["EPSG","4326"]]
Origin = (0.000000000000000,90.000000000000000)
Pixel Size = (0.008333333333333,-0.008333333333333)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=LZW
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (   0.0000000,  90.0000000) (  0d 0' 0.01"E, 90d 0' 0.00"N)
Lower Left  (   0.0000000,  60.0000000) (  0d 0' 0.01"E, 60d 0' 0.00"N)
Upper Right (  30.0000000,  90.0000000) ( 30d 0' 0.00"E, 90d 0' 0.00"N)
Lower Right (  30.0000000,  60.0000000) ( 30d 0' 0.00"E, 60d 0' 0.00"N)
Center      (  15.0000000,  75.0000000) ( 15d 0' 0.00"E, 75d 0' 0.00"N)
Band 1 Block=3600x1 Type=Float32, ColorInterp=Gray
  Min=207.000 Max=2958.000 
  Minimum=207.000, Maximum=2958.000, Mean=0.000, StdDev=0.000
  NoData Value=-3.39999999999999996e+38
  Metadata:
    STATISTICS_MAXIMUM=2958
    STATISTICS_MEAN=0
    STATISTICS_MINIMUM=207
    STATISTICS_STDDEV=0

EPSG 4326 describes the dataset.

3) I downloaded the shapefile with the world national administrative boundaries (Gridded Population of the World (GPW), v3) at http://sedac.ciesin.columbia.edu/data/set/gpw-v3-national-admin-boundaries/data-download. I selected the following: Region: Global, Data Set: National Boundaries, Data Attributes: .shp and circa 2000. I saved the downloaded file in /home/user/Myproject/Vector/ as /home/user/Myproject/Vector/nat_bound.shp.

The dataset has the following Spatial Reference Metadata (http://sedac.ciesin.columbia.edu/data/set/gpw-v3-national-admin-boundaries/metadata):

    Horizontal Coordinate System Definition:
        Geographic:
            Latitude Resolution: 0.000000
            Longitude Resolution: 0.000000
            Geographic Coordinate Units: Decimal degrees
        Geodetic Model:
            Horizontal Datum Name: WGS84
            Ellipsoid Name: WGS84
            Semi-major Axis: 6378137.000000
            Denominator of Flattening Ratio: 298.257224

This matches the EPSG 4326 in the Worldclim GeoTIFFs. No reprojection is required.

4) I opened the shapefile /home/user/Myproject/Vector/natbound.shp in QGIS. I selected national boundaries of Norway and Sweden and saved selections as /home/user/Myproject/Vector/Norway.shp and /home/user/Myproject/Vector/Sweden.shp, respectively.

5) I masked WorldClim data using two country shapefiles. The following is the code to process Bioclim variable 12:

-my code
gdalwarp -q -cutline /home/user/My_project/Vector/Norway.shp -crop_to_cutline -of GTiff /home/user/My_project/Bioclim_data/bio12_06.tif /home/user/My_project/Raster/bio12_06_masked_Norway.tif
gdalwarp -q -cutline /home/user/My_project/Vector/Norway.shp -crop_to_cutline -of GTiff /home/user/My_project/Bioclim_data/bio12_07.tif /home/user/My_project/Raster/bio12_07_masked_Norway.tif
gdalwarp -q -cutline /home/user/My_project/Vector/Norway.shp -crop_to_cutline -of GTiff /home/user/My_project/Bioclim_data/bio12_16.tif /home/user/My_project/Raster/bio12_16_masked_Norway.tif
gdalwarp -q -cutline /home/user/My_project/Vector/Sweden.shp -crop_to_cutline -of GTiff /home/user/My_project/Bioclim_data/bio12_06.tif /home/user/My_project/Raster/bio12_06_masked_Sweden.tif
gdalwarp -q -cutline /home/user/My_project/Vector/Sweden.shp -crop_to_cutline -of GTiff /home/user/My_project/Bioclim_data/bio12_16.tif /home/user/My_project/Raster/bio12_16_masked_Sweden.tif

The code above masked parts of the two countries, by tile. The results were saved in /home/user/Myproject/Raster/ as bioAABBmaskedCOUNTRY.tif, where AA is the bioclim variable number, BB is the tile number, COUNTRY is either Norway or Sweden, e.g. bio1206masked_Norway.tif.

6) I merged all the tif files with different parts of Norway (Sweden) in a single tif file.

-my code
pkmosaic -i /home/user/My_project/Raster/bio12_06_masked_Sweden.tif -i /home/user/My_project/Raster/bio12_16_masked_Sweden.tif -o /home/user/My_project/Raster/bio12_masked_Sweden_merged.tif
pkmosaic -i /home/user/My_project/Raster/bio12_06_masked_Norway.tif -i /home/user/My_project/Raster/bio12_07_masked_Norway.tif -i /home/user/My_project/Raster/bio12_16_masked_Norway.tif -o /home/user/My_project/Raster/bio12_masked_Norway_merged.tif

7) Frequency distributions of the environmental variables (histograms) were obtained for every tif file using GUI in QGIS.

8) An alternative to steps 5) and 6) above is to merge the WorldClim tiles first and then apply two country masks. The code is shorter but at one stage the files are larger.

-my code 2
pkmosaic -i /home/user/My_project/Bioclim_data/bio12_06.tif -i /home/user/My_project/Bioclim_data/bio12_07.tif -i /home/user/My_project/Bioclim_data/bio12_16.tif -o /home/user/My_project/Raster/bio12_merged.tif
gdalwarp -q -cutline /home/user/My_project/Vector/Norway.shp -crop_to_cutline -of GTiff /home/user/My_project/Raster/bio12_merged.tif /home/user/My_project/Raster/bio12_masked_Norway.tif
gdalwarp -q -cutline /home/user/My_project/Vector/Sweden.shp -crop_to_cutline -of GTiff /home/user/My_project/Raster/bio12_merged.tif /home/user/My_project/Raster/bio12_masked_Sweden.tif

Computational implementation

Some further explanation of the overall analyses and of each step paste your code here

- my code
# masking every tile downloaded from WorlClim dataset using the boundaries of Norway (3 tiles) and Sweden (2 tiles) 
gdalwarp -q -cutline /home/user/My_project/Vector/Norway.shp -crop_to_cutline -of GTiff /home/user/My_project/Bioclim_data/bio12_06.tif /home/user/My_project/Raster/bio12_06_masked_Norway.tif
gdalwarp -q -cutline /home/user/My_project/Vector/Norway.shp -crop_to_cutline -of GTiff /home/user/My_project/Bioclim_data/bio12_07.tif /home/user/My_project/Raster/bio12_07_masked_Norway.tif
gdalwarp -q -cutline /home/user/My_project/Vector/Norway.shp -crop_to_cutline -of GTiff /home/user/My_project/Bioclim_data/bio12_16.tif /home/user/My_project/Raster/bio12_16_masked_Norway.tif
gdalwarp -q -cutline /home/user/My_project/Vector/Sweden.shp -crop_to_cutline -of GTiff /home/user/My_project/Bioclim_data/bio12_06.tif /home/user/My_project/Raster/bio12_06_masked_Sweden.tif
gdalwarp -q -cutline /home/user/My_project/Vector/Sweden.shp -crop_to_cutline -of GTiff /home/user/My_project/Bioclim_data/bio12_16.tif /home/user/My_project/Raster/bio12_16_masked_Sweden.tif
# merging all tif files with different parts of Norway (Sweden) in a single tif file for each country
pkmosaic -i /home/user/My_project/Raster/bio12_06_masked_Sweden.tif -i /home/user/My_project/Raster/bio12_16_masked_Sweden.tif -o /home/user/My_project/Raster/bio12_masked_Sweden_merged.tif
pkmosaic -i /home/user/My_project/Raster/bio12_06_masked_Norway.tif -i /home/user/My_project/Raster/bio12_07_masked_Norway.tif -i /home/user/My_project/Raster/bio12_16_masked_Norway.tif -o /home/user/My_project/Raster/bio12_masked_Norway_merged.tif

Describe your second code if needed, what it does …

- my code 2
# my alternative code here
# merging three tiles of the WorldClim dataset for bioclimatic variable 12
pkmosaic -i /home/user/My_project/Bioclim_data/bio12_06.tif -i /home/user/My_project/Bioclim_data/bio12_07.tif -i /home/user/My_project/Bioclim_data/bio12_16.tif -o /home/user/My_project/Raster/bio12_merged.tif
# applying the mask for Norway
gdalwarp -q -cutline /home/user/My_project/Vector/Norway.shp -crop_to_cutline -of GTiff /home/user/My_project/Raster/bio12_merged.tif /home/user/My_project/Raster/bio12_masked_Norway.tif
# applying the mask for Sweden
gdalwarp -q -cutline /home/user/My_project/Vector/Sweden.shp -crop_to_cutline -of GTiff /home/user/My_project/Raster/bio12_merged.tif /home/user/My_project/Raster/bio12_masked_Sweden.tif

Model parametrization

N/A.

Model prediction

N/A.

Validation

N/A.

RESULTS and DISCUSSION

Show us the output of the analyses upload images if needed with “add images” link in the upper bar of this window while editing

  • Map 1. Distribution of Bioclim12 variable (annual precipitation) in Norway.
  • Map 2. Distribution of Bioclim12 variable (annual precipitation) in Sweden.
  • Histogram 1. Frequency distribution of Bioclim12 variable (annual precipitation) in Norway.
  • Histogram 2. Frequency distribution of Bioclim12 variable (annual precipitation) in Sweden.

Later on after the training you could improve the script and upgrade your wiki project page

wikistudholland/utwente_vladimir.txt · Last modified: 2021/01/20 20:36 (external edit)