Skip to content

What is a GeoRegion?

Simply put, a GeoRegion is a geographic region. In v1 of GeoRegions.jl, a GeoRegion could only be rectilinear in shape. However, as of GeoRegions.jl v2, we use Julia types to differentiate between rectilinear GeoRegions, and GeoRegions of arbitrary polygonal shape:

  • Rectilinear GeoRegions are denoted by the RectRegion type

  • Polygonal GeoRegions are denoted by the PolyRegion type

The main difference between a PolyRegion and a RectRegion, is that a PolyRegion also contains a mask field which allows us to extract a data field of a polygonal shape from the rectilinear bounds that are the natural result of a rectilinear grid.

# GeoRegions.GeoRegionType.
julia
GeoRegion

Abstract supertype for geographical regions, with the following subtypes:

RectRegion{ST<:AbstractString, FT<:Real} <: GeoRegion
PolyRegion{ST<:AbstractString, FT<:Real} <: GeoRegion

Both RectRegion and PolyRegion types contain the following fields:

  • ID - A String Type, the identifier for the GeoRegion

  • pID - A String Type, the identifier for the parent GeoRegion

  • name - A String Type, the full name of the GeoRegion

  • N - A Float Type, the north boundary of the GeoRegion

  • S - A Float Type, the south boundary of the GeoRegion

  • E - A Float Type, the east boundary of the GeoRegion

  • W - A Float Type, the est boundary of the GeoRegion

  • is180 - A Bool Type, is W < 0

  • is360 - A Bool Type, is E > 180

A PolyRegion type will also contain the following field:

  • shape - A vector of Point2 Types, defining a non-rectilinear shape of the GeoRegion

source


In essence, a GeoRegion is:

  • a geographical region that can be either rectilinear region, or a polygonal shape within a specified rectilinear bound.

  • identified by an ID

  • itself a subregion of a parent GeoRegion (identified by pID, which must itself be a valid ID)

Default GeoRegions

When using GeoRegions.jl, the default GeoRegion should generally be the global domain, specified by GLB and given by the [N,S,E,W] coordinates [90,-90,360,0]. The Global GeoRegion GLB is considered to be a subset of itself.