cd /etc/apt/
sudo vim sources.list
# paste the following
# QGIS 3 install
deb https://qgis.org/ubuntu-ltr/ bionic main
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
### <summary> | |
### Basic template algorithm simply initializes the date range and cash. This is a skeleton | |
### framework you can use for designing an algorithm. | |
### </summary> | |
class BasicTemplateAlgorithm(QCAlgorithm): | |
'''Basic template algorithm simply initializes the date range and cash''' | |
def Initialize(self): |
!!! This Gist tutorial is deprecated. Its new version is available here !!!
This is some red text.
- Author: Thomas Girke
- Last update: 18-Nov-2020
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gdal_mean <- function(infile, outfile, return_raster=FALSE, overwrite=FALSE) { | |
# Be aware that the outfile type will be the same as the infile type | |
require(rgdal) | |
if(return_raster) require(raster) | |
# infile: The multiband raster file (or a vector of paths to multiple | |
# raster files) for which to calculate cell mean. | |
# outfile: Path to raster output file. | |
# return_raster: (logical) Should the output raster be read back into R? | |
# overwrite: (logical) Should outfile be overwritten if it exists? | |
gdal_calc <- Sys.which('gdal_calc.py') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Alternative to a doubly-nested loop | |
# Imagine I want to perform an operation on a data frame | |
# once for each combination of two variables, such as Country and Year | |
# I can do this with a nested loop, or I can do this with (among other | |
# things) lapply() | |
# Generate random data: | |
allCountries <- LETTERS[1:10] | |
allYears <- 1990:2012 |