Code Monkey home page Code Monkey logo

a2_grass_gis's Introduction

Assignment 2: GIS analyses using GRASS GIS

Submission deadline is Friday, December 11 2020 through GitHub Classroom.

Documents to hand in:

  • Markdown file answers.md for exercises 1 - 4
  • Python file for exercise 5

In this assignment you will use the program GRASS GIS to conduct a geospatial analysis using raster and vector data.

This is a group assignment in which you are supposed to solve these exercises in pairs of two students. Material and submission will be handled through GitHub Classroom.

Write the answers to the questions in a new markdown file called answers.md. Please use Markdown syntax to format your document.

Data

All data for the assignment is stored in the repository in the folder "data":

  • Global Human Settlement Layer: Population (GHS_POP_E2015_GLOBE_R2019A_54009_250_V1_0_18_3.tif)
  • GDAM Administrative districts of Germany (gadm28_adm2_germany.shp)
  • Motorways extracted from OSM (motorways.shp)

1. Create new location in GRASS GIS

Create a new location called "BadenWuerttemberg". The coordinate references system should be the same as the raster file GHS_POP_E2015_GLOBE_R2019A_54009_250_V1_0_18_3.tif.

2. Import data

Import the following data sets into the PERMANENT mapset. Use the commands v.import, v.in.ogr, r.import or r.in.ogr.

2.1 Motorways

Import the motorways.shp into the PERMANENT mapset.

2.2 Administrative Districts of Baden-Württemberg

Import only the districts of Baden-Württemberg from the gadm28_adm2_germany.shp into the PERMANENT mapset.

Hint: You need to convert gadm28_adm2_germany.shp first to the correct coordinate reference system.

2.3 Global Human Settlement Layer

If you haven't done so during the creation of the new location, import the Global Human Settlement Layer.

3. Calculate the total population of the districts

The goal of this section is to calculate the total population of each district.

3.1 Set the region

Set the region to the extent of the districts layer. Make sure that the resolution of the region is 250 by 250 meters. Use the g.region tool.

3.2 Rasterize the districts

In order to calculate zonal statistics in GRASS GIS, the districts need to be in raster format. Rasterize the districts. The cells of the raster should contain the OBJECTID of the district features.

3.3 Calculate the population of each district

Use the tool r.stats.zonal to calculate the total population of each district. The Global Human Settlement Layer contains the number of people living in each cell. Choose the aggregation method accordingly.

3.4. Evaluate the population estimate

Use the "Query raster/vector maps" tool in the top menu of the Map Display window and click on the districts in the map to get the calculated population numbers of each one. How good is the population estimate of the Global Human Settlement Layer compared to official data?

4. Calculate total population living within 1km of motorways

Use the same method as above to calculate the total population living within 1 kilometer distance to the motorways. Set the region to the extent of the motorways layer before you start processing. Print the population value using the r.stats tool.

5. Convert the script to Python

  1. Convert the workflow described in section 4 to a Python script.

  2. Use a for loop to calculate the population living close to motorways using different buffer distances: 250, 500, 1000, 2500 and 5000 meters.

References

GRASS GIS 7.8 Manual

a2_grass_gis's People

Contributors

michaelsjp avatar redfrexx avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.