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 :: BoolCheck if a geographical point point is within a GeoRegion defined by geo.
Arguments
point: A geographical point of TypePoint. PassPoint(plon,plat), whereplonandplatare the longitude and latitudes of the point.geo: The GeoRegion struct container.
Keyword Arguments
throw: Iftrue, then ifpointis 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/falseboolean.
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 :: BoolCheck 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 theGeoRegions into. Default is 100.throw: Iftrue, then ifcgeois 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/falseboolean.
On
Is Point On a GeoRegion
GeoRegions.on Method
on(
point :: Point2{<:Real},
geo :: GeoRegion;
throw :: Bool = false,
sigdigits :: Int = 10
) -> tf :: BoolCheck 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), whereplonandplatare the longitude and latitudes of the point.geo: The GeoRegion struct container.
Keyword Arguments
throw: Iftrue, then ifpointis 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/falseboolean.
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 :: BoolCheck 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 theGeoRegions into. Default is 2.throw: Iftrue, then ifgeo1does 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/falseboolean.
Equivalence of GeoRegions
Base.:== Method
==(
geo1 :: GeoRegion,
geo2 :: GeoRegion,
) -> tf :: BoolChecks (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/falseboolean.
Base.isequal Method
isequal(
geo1 :: GeoRegion,
geo2 :: GeoRegion;
verbose :: Bool = false
) -> tf :: BoolChecks (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/falseboolean.
Does this GeoRegion already Exist?
GeoRegions.isgeo Method
isgeo(
geo :: GeoRegion;
path :: AbstractString = dirname(geo.path),
throw :: Bool = true,
verbose :: Bool = false
) -> tf :: BoolChecks 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 noGeoRegiondefined inpathwith the same characteristics or field values asgeo.verbose: Verbose logging for ease of monitoring? Default isfalse.
Returns
tf: Atrue/falseboolean.
Equivalence of GeoRegion IDs
GeoRegions.isID Method
isID(
ID :: AbstractString;
path :: AbstractString = homedir(),
throw :: Bool = true,
verbose :: Bool = false
) -> tf :: BoolChecks 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 ifIDis not a validGeoRegionidentifier instead of returning the Booleantf.verbose: Verbose logging for ease of monitoring? Default isfalse.
Returns
tf: Atrue/falseboolean.
Equivalence of GeoRegion Shapes
GeoRegions.isgeoshape Method
isgeoshape(
geo :: GeoRegion;
path :: AbstractString = dirname(geo.path),
returnID :: Bool = true,
verbose :: Bool = false
) -> tf :: BoolChecks 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 theIDof theGeoRegioninpathwith the same shape asgeo.verbose: Verbose logging for ease of monitoring? Default isfalse.
Returns
tf: Atrue/falseboolean.
GeoRegions.isgeoshape Method
isgeoshape(
lon :: Vector{<:Real},
lat :: Vector{<:Real};
path :: AbstractString = dirname(geo.path),
returnID :: Bool = true,
verbose :: Bool = false
) -> tf :: BoolChecks 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 theIDof theGeoRegioninpathwith the same shape asgeo.verbose: Verbose logging for ease of monitoring? Default isfalse.
Returns
tf: Atrue/falseboolean.