Rnightlights (version 0.1.2)

ZonalPipe: Create a zonal file if it does not exist and calculate the zonal stats

Description

Create a zonal file if it does not exist and calculate the zonal stats by calling the myZonal function. Modified from http://www.guru-gis.net/efficient-zonal-statistics-using-r-and-gdal/

Usage

ZonalPipe(ctryCode, ctryPoly, path.in.shp, path.in.r, path.out.r, path.out.shp,
  zone.attribute, stats)

Arguments

ctryCode

the ctryCode of interest

ctryPoly

the SpatialPolygonsDataFrame country polygon to process

path.in.shp

The path to the country shapefile

path.in.r

The path to the raster tile

path.out.r

The path where to save the output zonal raster

path.out.shp

The path to save the output zonal shapefile (Ignored)

zone.attribute

The zonal attribute to calculate

stats

The stats to calculate

Value

TRUE/FALSE