Skip to content

API for Project-Handling in GeoRegions.jl

Setting up GeoRegions.jl in a Project

GeoRegions.setupGeoRegions Function
julia
setupGeoRegions(;
    path :: AbstractString = pwd(),
    overwrite :: Bool = false
) -> nothing

Setup the directory specified by path with files for custom GeoRegions. If overwrite = true, then any preexisting files are overwritten.

Keyword Arguments

  • path : The path where the template list of custom GeoRegions will be copied to. Defaults to the current working directory pwd().

  • overwrite : If template files exist in this folder, overwrite?

source
GeoRegions.deleteGeoRegions Function
julia
deleteGeoRegions(;
    path :: AbstractString = pwd(),
    recursive :: Bool = false,
) -> nothing

Reset all the files containing GeoRegion information back to the default. If recursive = true, delete the entire directory.

Keyword Arguments

  • path : The path where the list of custom GeoRegions will be retrieved from. Defaults to the current working directory pwd().

  • recursive : If true, then delete the hidden .georegions folder entirely.

source

Handling custom lists of GeoRegions.jl

GeoRegions.loadGeoRegions Function
julia
loadGeoRegions(;
    path :: AbstractString = pwd(),
    custom :: Bool = true,
    giorgi :: Bool = false,
    srex   :: Bool = false,
    ar6    :: Bool = false,
) -> gvec :: Vector{<:GeoRegion}

Extract information for all custom GeoRegions in the project defined by defined by path.

Arguments

  • path : Path where all custom GeoRegions for the project are saved into.

  • custom : If true, custom, user-defined list of GeoRegions will be displayed.

  • giorgi : If true AND predefined = true, display predefined GF GeoRegions. Default is false.

  • srex : If true AND predefined = true, display predefined SREX GeoRegions. Default is false.

  • ar6 : If true AND predefined = true, display predefined IPCC AR6 GeoRegions. Default is false.

Returns

  • gvec : Vector containing all the GeoRegions in the directory defined by path.
source
GeoRegions.addGeoRegions Function
julia
addGeoRegions(
    src :: AbstractString,
    dst :: AbstractString = pwd();
    overwrite :: Bool = false,
    verbose   :: Bool = false,
    dogeopath :: Bool = true
) -> nothing

Copy all custom GeoRegions from the project directory defined by src into a new project directory defined by dst.

Arguments

  • src : The project path where the list of custom GeoRegions will be copied from.

  • dst : The project path where the list of custom GeoRegions will be copied into.

Keyword Arguments

  • overwrite : If true, override any custom GeoRegions that have the same IDs as those in the file fname.

  • verbose : Verbose logging for ease of monitoring? Default is false.

  • dogeopath : If true, then the appends .georegions to the end of src if it isn't already specified. Default is true

source