Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Lund 2015 - QGIS workshop

1,175 views

Published on

Workshop held at Lund University in 2015

Published in: Environment
  • If you’re looking for a great essay service then you should check out ⇒ www.WritePaper.info ⇐. A friend of mine asked them to write a whole dissertation for him and he said it turned out great! Afterwards I also ordered an essay from them and I was very happy with the work I got too.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • The essay is the most important part of a college application, so you need to focus and make a good essay to convince the university accept you. You even get help from essay writing expert to ensure you acceptance. Check out, please HelpWriting.net
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Lund 2015 - QGIS workshop

  1. 1. Workshop – Lund 2015 1 Landscape ecology analysis with QGIS Workshop at Lund University (2015) by Martin Jung
  2. 2. Workshop – Lund 2015 2 About me ● BSc thesis about plant-pollinator networks in Białowieza ● MSc thesis about broad-scale biodiversity modelling ● Starting a PhD in september on Global biodiversity impacts of land-use dynamics ● Using QGISQGIS since many years, two plugins (LecoS, QSDM) Twitter: @Martin_Ecology Blog: http://conservationecology.wordpress.com/
  3. 3. Workshop – Lund 2015 3 Roadplan for today 1 Working with GIS formats and attributes in QGIS 2 Projections 3 Introduction to Georeferencing with QGIS … Short break somewhere here ... 4 Landscape Analysis with QGIS (LecoS) 5 Questions and problems (...Open end...)
  4. 4. Workshop – Lund 2015 4 Now install (if you haven't already) ● Make some room on your computer (at least 1 GB !) ● Install the current Stable Version ( QGIS 2.8 ) on your computer (see provided folder) for Windows ● MAC-Users: Download QGIS and install python libraries ● (http://www.kyngchaos.com/software/python ) Important! – Make sure the libraries python-scipy, python-numpy, python-pil and python- matplotlib are checked
  5. 5. Workshop – Lund 2015 5 ● Select “Advanced Install” ● “Install from local Folder” ● Mark everything – Qgis – Python-numpy – Python-scipy – ... How to install (WIN) Install from local folder
  6. 6. Workshop – Lund 2015 6 GIS data formats Source: maprabu.blogspot.com Format: *.shp, *.csv, *.gpx, *.kml, ... Format: *.tif, *.vrt, *.hdr, *.asc, ...
  7. 7. Workshop – Lund 2015 7 Raster vs vector ● Vector – Advantage: Accuracy, more visually pleasing – Disadvantage: Space-inefficient. Every vertex needs to be stored. Algorithms computational intensive. ● Raster – Advantage: Geogr. Position associated with data, easier for analysis – Disadvantage: Resolution dependent on cellsize. Often not nice- looking
  8. 8. Workshop – Lund 2015 8 Other data sources ● Google, Bing, Openstreetmaps, ... ( OpenLayers plugin) ● WMS server, for instance the EEA WMS services – http://discomap.eea.europa.eu/home.html – Can be loaded into QGIS as WMS layer Those files can be visualized, but not edited (see WFS) !!! You can make a screenshot though and georeference this, but check the publishers license!
  9. 9. Workshop – Lund 2015 9 A note on proprietary formats ● Long-term ArcGIS users are often confronted with .lyr files – Proprietary format by ESRI. Container that stores data and viz ● (Open-source alternative in QGIS ← .qlr ) ● TMK: Not convertible without having a ESRI license! – Arc2Earth extension for ArcMap lets you save .lyr to .sld
  10. 10. Workshop – Lund 2015 10 What are Map projections ● Map projections to represent a 3-dimensional structure on a 2d planar plane ● Many formats and types – Spherical, azimuthal, equidistant, equal area, … – Most commonly used: ● WGS84 (lon,lat ← In degree) ● WGS84 Google Pseudo-Mercator (in meter, but inaccurate in tropics!!! ) ● WGS84 UTM (in meter, subdivided in lon-lat grids) http://epsg.io/ ← Lookup projections
  11. 11. Workshop – Lund 2015 11 Now hands on in QGIS
  12. 12. Workshop – Lund 2015 12 Geo-referencing with QGIS ● GR is the process of associating data with spatial coordinates ● In QGIS using the excellent gdal-referencer ● What we need: – A non-spatial file – A reference projection – Reference points or ROI Harsjön
  13. 13. Workshop – Lund 2015 13 (1) Get the geocode plugin (or use the bar) to jump to 59.55275,18.33490 long-lat (2) Load Google layers or any other WMS service (3) Make sure the gdal-georeferencer is available (Raster menu) (4) Add the Harsjön.tif file to the referencer and add around 5-6 GCP points – Choose linear interpolation (5) Now you have the rasterized the map and create a new vector point layer with the study-locations
  14. 14. Workshop – Lund 2015 14 Visualizing Gradients ● Add the pH-0915_3.csv to QGIS via “Add-delimited- Text-layer” ● Specify RT90 2.5 gon V as projection (assumed) ● Color the points with the Ph attribute ● Subset to Skane (Select – Save Selection). Computational intensive!!! ● Use the Heatmap plugin (Ph as weight) or GRASS- modules in Processing (v.surf.*) Vector Raster
  15. 15. Workshop – Lund 2015 15 Use the new Heatmap renderer (QGIS 2.8)
  16. 16. Workshop – Lund 2015 16 Short Break Kort paus Kurze Pause
  17. 17. Workshop – Lund 2015 17 LecoS ● Simple Plugin to extract landscape metrics from raster layer ● Inspired by FRAGSTAT ● With Graphical interface, but more options available in Processing Toolbox
  18. 18. Workshop – Lund 2015 18 Example Data set Use the data within the Gotland zip file
  19. 19. Workshop – Lund 2015 19 Research questions 1) What is the most abundant land-cover type in the study locations? 2) How much combined forest is there in our study sites? 3) How heterogen is the landcover in our study-sites? 4) What is the distance to the Forest-edge for each of our sites? ● (Optional) Neutral Landscape Models with NLMPy
  20. 20. Workshop – Lund 2015 20 Landscape analysis preparation Landscape Layer Studylocations with 500m Buffer
  21. 21. Workshop – Lund 2015 21 Research Question 1.) ● Crop your the raster dataset with your buffered Studysites (overlapping buffers are not correctly cropped. Use DissolveDissolve first) ● Use “LecoS – Land cover statistics” to compute the “Landscape proportion” of each land cover class ● Use “Groupstats”, “QScatter” or “Statist” to get the aggregated values – Or export to csv and open with a spreadsheet program!
  22. 22. Workshop – Lund 2015 22 Results Question 1.) Results Top 3: 30 (Åkermark) Arable land→ 21 % 44 (Barrskog ej på lavmark 7-15 meter) Coniferous forest →17 % 32 (Betesmark) Pasture → 11 %
  23. 23. Workshop – Lund 2015 23 Research Question 2.) ● Isolate all forest cover from both datasets using the raster calculator (Classes 40 – 50) ● ("Layer_Gotland@1" >= 40 AND "Layer_Gotland@1" <= 50)("Layer_Gotland@1" >= 40 AND "Layer_Gotland@1" <= 50) ● Use “LecoS – Polygon overlay” to compute the Total forest cover for each buffer ● Ether add to attribute table (Layer needs to be reloaded ) or save as csv
  24. 24. Workshop – Lund 2015 24 Results Question 2.) ● On average: – 285874 m² (28.58 ha)
  25. 25. Workshop – Lund 2015 25 Research Question 3.) ● In order to measure land-cover heterogeneity you have 2 options: – Ether use the Moving Window in the Processing Toolbox, select variety and an appropriate window size – Afterwards extract the mean for each of your buffers using the polygon-overlay ● Or – Use the LecoS polygon-overlay tool to compute a “diversity-index” like Shannon or Simpson index for each of your buffers
  26. 26. Workshop – Lund 2015 26 Research Question 3.)
  27. 27. Workshop – Lund 2015 27 Research Question 4.) The landscape modifier ● Clean Map of small pixels ● Extract the forest edge of the previous generated forest extract. ● Then use the Proximity tool in the Raster menu ● Use the Save-As function (rightclick raster) to correctly set a nodata-value ● Use LecoS to extract the median values inside the grid per buffer or point
  28. 28. Workshop – Lund 2015 28 Results question 4.) FeatureID 27 + 30 farthest away from forest edge ~ 942m and 522m
  29. 29. Workshop – Lund 2015 29 (Optional) Neutral Landscape Models (NLMpy) ● LecoS has optional NLMpy support since version 1.9.3 ● Neutral Landscape Models as “Nullmodel” for continuous and classified landscapes ● Publication: ● onlinelibrary.wiley.com/doi/10 .1111/2041-210X.12308/full
  30. 30. Workshop – Lund 2015 30 How to get the library? ● In order to install non-supported libraries you have to use PIP (python package index). ● NO Guarantee that this will work for your! ● https://pypi.python.org/pypi/nlmpy – Open the Python console in QGIS (or terminal on Linux) – Run pip install nlmpy – Or alternatively download and pip install nlmpy-0.1.1.tar.gz
  31. 31. Workshop – Lund 2015 31 Time for Map Presentation?
  32. 32. Workshop – Lund 2015 32 Running scripts in the Processing Toolbox ● The Processing toolbox (formerly called Sextante) in QGIS can be used to write models and script to do repeatable tasks ● Currently Python and R scripts are supported ● In order to create a R-script, make sure that it is enabled in the Processing options (menu)
  33. 33. Workshop – Lund 2015 33 Other useful stuff - Processing R commands Command Function ##[datagis]=group Sets the group to “datagis” ##layer = vector or raster Specifies the input layer to use ##distance=number 100 Sets a number field with default 100 ##title=string France Get text input. Default is “France” ##field=field layer Select a field from the vector layer “layer” hist(layer[[field]]) R-command: Histogram for fields from layer ##showplots Has to be set in order to see plot outputs >t.test(layer[[field]]) Console output with a “>” before command ##output=output vector File output as vector or raster
  34. 34. Workshop – Lund 2015 34 Example Script ##[Own Scripts]=group ##showplots ##layer=vector ##y=field layer ##x=field layer plot(as.numeric( layer[[y]] )~as.numeric( layer[[x]] ),pch=19,bty="l",ylab=paste( y ),xlab=paste( x ) ) fit = lm( layer[[y]]~layer[[x]] ) abline(fit,col="blue",lwd=2)
  35. 35. Workshop – Lund 2015 35 Additional examples, help and tutorials ● http://www.gistutor.com/ ● http://qgis.spatialthoughts.com/ ● Youtube → search QGIS ● http://gis.stackexchange.com ● QGIS-user mailing list → http://lists.osgeo.org/listinfo/qgis-user
  36. 36. Workshop – Lund 2015 36 Thanks for your attention! Open questions....!

×