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
typePolygonal 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.
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
- AString
Type, the identifier for the GeoRegionpID
- AString
Type, the identifier for the parent GeoRegionname
- AString
Type, the full name of the GeoRegionN
- AFloat
Type, the north boundary of the GeoRegionS
- AFloat
Type, the south boundary of the GeoRegionE
- AFloat
Type, the east boundary of the GeoRegionW
- AFloat
Type, the est boundary of the GeoRegionis180
- ABool
Type, isW
< 0is360
- ABool
Type, isE
> 180
A PolyRegion
type will also contain the following field:
shape
- A vector ofPoint2
Types, defining a non-rectilinear shape of the GeoRegion
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 bypID
, which must itself be a validID
)
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.