Learn R Programming

Rnightlights (version 0.1.2)

fnAggRadGdal: Calculate zonal statistics using GDAL. Faster than fnAggRadRast for large polygons.

Description

Calculate zonal statistics. Alternative to fnAggRadRast using GDAL. Faster for large polygons. Modified from http://www.guru-gis.net/efficient-zonal-statistics-using-r-and-gdal/

Usage

fnAggRadGdal(ctryCode, ctryPoly, nlPeriod, fnStats = pkgOptions("stats"),
  nlType)

Arguments

ctryCode

character string the ISO3 country code to be processed

ctryPoly

Polygon the loaded country polygon layer

nlPeriod

character string the nlPeriod to be processed

fnStats

character vector The stats to calculate

nlType

the nlType of interest

Value

data.frame of polygon attributes and the calculated stats

Examples

Run this code
# NOT RUN {
validNlMonthNum("01","VIIRS")
# }
# NOT RUN {
 #returns TRUE

# }

Run the code above in your browser using DataLab