API for Is it in/on/equal to a GeoRegion?
In
Is Point In a GeoRegion
Base.in Method
in(
point :: Point2{<:Real},
geo :: GeoRegion;
throw :: Bool = false,
sigdigits :: Int = 10
) -> tf :: Bool
Check if a geographical point point
is within a GeoRegion defined by geo
.
Arguments
point
: A geographical point of TypePoint
. PassPoint(plon,plat)
, whereplon
andplat
are the longitude and latitudes of the point.geo
: The GeoRegion struct container.
Keyword Arguments
throw
: Iftrue
, then ifpoint
is not withingeo
, an error is thrown and the program stops running.sigdigits
: Specifies number of significant digits (i.e., precision) of the point coordinates used for checking. Defaults to 10.
Returns
tf
: Atrue
/false
boolean.
Is GeoRegion In a GeoRegion
Base.in Method
in(
cgeo :: GeoRegion,
geo :: GeoRegion;
n :: Int = 100,
throw :: Bool = false,
verbose :: Bool = false,
sigdigits :: Int = 10
) -> tf :: Bool
Check if a child GeoRegion defined by cgeo
is within another GeoRegion geo
.
Arguments
cgeo
: A GeoRegion that we postulate to be a "child", or a subset of the GeoRegion defined bygeo
.geo
: A GeoRegion that we postulate to be a "parent", or containing the GeoRegion defined bycgeo
.
Keyword Arguments
n
: The number of segments to split each of theGeoRegion
s into. Default is 100.throw
: Iftrue
, then ifcgeo
is not withingeo
, an error is thrown and the program stops running.verbose
: Iftrue
, print logs to screen.sigdigits
: Specifies number of significant digits (i.e., precision) of the point coordinates used for checking. Defaults to 10.
Returns
tf
: Atrue
/false
boolean.
On
Is Point On a GeoRegion
GeoRegions.on Method
on(
point :: Point2{<:Real},
geo :: GeoRegion;
throw :: Bool = false,
sigdigits :: Int = 10
) -> tf :: Bool
Check if a geographical point point
is on the boundary of a shape of a GeoRegion defined by geo
.
Arguments
point
: A geographical point of TypePoint
. PassPoint(plon,plat)
, whereplon
andplat
are the longitude and latitudes of the point.geo
: The GeoRegion struct container.
Keyword Arguments
throw
: Iftrue
, then ifpoint
is not withingeo
, an error is thrown and the program stops running.sigdigits
: Specifies number of significant digits (i.e., precision) of the point coordinates used for checking. Defaults to 10.
Returns
tf
: Atrue
/false
boolean.
Is GeoRegion On a GeoRegion
GeoRegions.on Method
on(
geo1 :: GeoRegion,
geo2 :: GeoRegion;
n :: Int = 2,
throw :: Bool = false,
verbose :: Bool = false,
sigdigits :: Int = 10
) -> tf :: Bool
Check if the GeoRegions geo1
and geo2
have the same shape. The order of geo1
and geo2
does not matter.
Arguments
geo1
: The first GeoRegiongeo2
: The second GeoRegion
Keyword Arguments
n
: The number of segments to split each of theGeoRegion
s into. Default is 2.throw
: Iftrue
, then ifgeo1
does not have the same shape asgeo2
, an error is thrown and the program stops running.verbose
: Iftrue
, print logs to screen.sigdigits
: Specifies number of significant digits (i.e., precision) of the point coordinates used for checking. Defaults to 10.
Returns
tf
: Atrue
/false
boolean.
Equivalence of GeoRegions
Base.:== Method
==(
geo1 :: GeoRegion,
geo2 :: GeoRegion,
) -> tf :: Bool
Checks (a) ID, (b) pID, (c) rotation, and (d) the geometry/shape of two different GeoRegions in order to determine if they are exactly the same.
The geo1.shape
and geo2.shape
need not be exactly the same as long as they define the same area (i.e., the points in geo2
can be a circshift version of geo1
). They can also be offset from each other by 360º.
Arguments
geo1
: The first GeoRegion.geo2
: The second GeoRegion.
Returns
tf
: Atrue
/false
boolean.
Base.isequal Method
isequal(
geo1 :: GeoRegion,
geo2 :: GeoRegion;
verbose :: Bool = false
) -> tf :: Bool
Checks (a) ID, (b) pID, (c) rotation, and (d) the geometry/shape of two different GeoRegions in order to determine if they are exactly the same.
The geo1.shape
and geo2.shape
need not be exactly the same as long as they define exactly the same area (i.e., the points in geo2
can be a circshift()
version of geo1
).
Arguments
geo1
: The first GeoRegion.geo2
: The second GeoRegion.
Keyword Arguments
verbose
: Verbose logging for ease of monitoring? Default isfalse
.
Returns
tf
: Atrue
/false
boolean.
Does this GeoRegion already Exist?
GeoRegions.isgeo Method
isgeo(
geo :: GeoRegion;
path :: AbstractString = dirname(geo.path),
throw :: Bool = true,
verbose :: Bool = false
) -> tf :: Bool
Checks all the GeoRegions defined in the project determined by path
against a given GeoRegion geo
. If there is any GeoRegion tgeo
that returns isequal(geo,tgeo) = true
, then isgeo(geo) = true
. Otherwise, returns false
or throws an error.
Arguments
geo
: The GeoRegion in question.
Keyword Arguments
path
: The path where the list of custom GeoRegions will be retrieved from. Defaults to the directorygeo.path
.throw
: Iftrue
, then throws an error if there is noGeoRegion
defined inpath
with the same characteristics or field values asgeo
.verbose
: Verbose logging for ease of monitoring? Default isfalse
.
Returns
tf
: Atrue
/false
boolean.
Equivalence of GeoRegion IDs
GeoRegions.isID Method
isID(
ID :: AbstractString;
path :: AbstractString = homedir(),
throw :: Bool = true,
verbose :: Bool = false
) -> tf :: Bool
Checks if there is a GeoRegion, that exists in the custom lists defined in path
, with the ID ID
.
Arguments
ID
: The keyword ID that will be used to identify the GeoRegion. If the ID is not valid (i.e. not being used), then an error will be thrown.
Keyword Arguments
path
: The path where the list of custom GeoRegions will be retrieved from. Defaults to the current directorypwd()
.throw
: Iftrue
, then throws an error ifID
is not a validGeoRegion
identifier instead of returning the Booleantf
.verbose
: Verbose logging for ease of monitoring? Default isfalse
.
Returns
tf
: Atrue
/false
boolean.
Equivalence of GeoRegion Shapes
GeoRegions.isgeoshape Method
isgeoshape(
geo :: GeoRegion;
path :: AbstractString = dirname(geo.path),
returnID :: Bool = true,
verbose :: Bool = false
) -> tf :: Bool
Checks all the GeoRegions defined in the project determined by path
. If there exists a GeoRegion tgeo
such that on(geo,tgeo) = true
, then returns true
by default, or otherwise, if returnID
is true, it will return tgeo.ID
. If there is no GeoRegion
with the same shape, then either returns a false
or throws and error depending on throw
Arguments
geo
: The GeoRegion in question.
Keyword Arguments
path
: The path where GeoRegions will be retrieved from and compared against. Defaults to the directorygeo.path
.returnID
: Iftrue
, then returns theID
of theGeoRegion
inpath
with the same shape asgeo
.verbose
: Verbose logging for ease of monitoring? Default isfalse
.
Returns
tf
: Atrue
/false
boolean.
GeoRegions.isgeoshape Method
isgeoshape(
lon :: Vector{<:Real},
lat :: Vector{<:Real};
path :: AbstractString = dirname(geo.path),
returnID :: Bool = true,
verbose :: Bool = false
) -> tf :: Bool
Checks all the GeoRegions defined in the project determined by path
. If there exists a GeoRegion tgeo
with the same shape as defined by the vectors lon
and lat
, returns true
by default, or otherwise, if returnID
is true, it will return the tgeo.ID
. If there is no GeoRegion
with the same shape, then either returns a false
or throws and error depending on throw
Arguments
lon
: Vector of longitude points.lat
: Vector of latitude points.
Keyword Arguments
path
: The path where GeoRegions will be retrieved from and compared against. Defaults to the directoryhomedir()
.returnID
: Iftrue
, then returns theID
of theGeoRegion
inpath
with the same shape asgeo
.verbose
: Verbose logging for ease of monitoring? Default isfalse
.
Returns
tf
: Atrue
/false
boolean.