API for Derotations
Derotating a Shape
GeoRegions.derotatecoordinates Function
derotatecoordinates(
lon :: Vector{<:Real},
lat :: Vector{<:Real},
geo :: GeoRegion;
rotation :: Real = 0
) -> X :: Vector{<:Real}, Y :: Vector{<:Real}
Derotate coordinates given by the vectors of longitude and latitude, around the centroid of the GeoRegion, and return their X and Y cartesian positions in meters.
Arguments
lon
: AVector
containing the longitudes of the points.lat
: AVector
containing the latitudes of the points.geo
: A GeoRegion.
Keyword Arguments
rotation
: Angle (in degrees) of rotation for the final "derotated" coordinates about the GeoRegion centroid and projected into the X-Y cartesian coordinate system (in meters). A positive value relative togeo.θ
will turn the final values about the centroid in the anti-clockwise direction. Default is 0.
Returns
X
: A vector of X-coordinates (in meters) about the centroid for the shape of the GeoRegion.Y
: A vector of Y-coordinates (in meters) about the centroid for the shape of the GeoRegion.
derotatecoordinates(
pnts :: Vector{<:Real},
geo :: GeoRegion;
rotation :: Real = 0
) -> X :: Vector{<:Real}, Y :: Vector{<:Real}
Derotate coordinates given by a vector of Point2
Type, around the centroid of the GeoRegion geo
, and return their X and Y cartesian positions in meters.
Arguments
pnts
: AVector
ofPoint2
type, each containing a (lon,lat) point.geo
: A GeoRegion.
Keyword Arguments
rotation
: Angle (in degrees) of rotation for the final "derotated" coordinates about the GeoRegion centroid and projected into the X-Y cartesian coordinate system (in meters). A positive value relative togeo.θ
will turn the final values about the centroid in the anti-clockwise direction. Default is 0.
Returns
X
: A vector of X-coordinates (in meters) about the centroid for the shape of the GeoRegion.Y
: A vector of Y-coordinates (in meters) about the centroid for the shape of the GeoRegion.
GeoRegions.derotatecoordinates! Function
derotatecoordinates!(
lon :: Vector{<:Real},
lat :: Vector{<:Real},
geo :: GeoRegion;
rotation :: Real = 0
) -> nothing
In-place mutation of the lon
and lat
vectors. Derotate coordinates given by the vectors of longitude and latitude, around the centroid of the GeoRegion, and return their X and Y cartesian positions in meters.
Arguments
lon
: AVector
containing the longitudes of the points, values will be replaced by the derotated x-coordinates (in meters) about the centroid.lat
: AVector
containing the latitudes of the points, values will be replaced by the derotated y-coordinates (in meters) about the centroid.geo
: A GeoRegion.
Keyword Arguments
rotation
: Angle (in degrees) of rotation for the final "derotated" coordinates about the GeoRegion centroid and projected into the X-Y cartesian coordinate system (in meters). A positive value relative togeo.θ
will turn the final values about the centroid in the anti-clockwise direction. Default is 0.
Derotating a Point Coordinate
GeoRegions.derotatepoint Function
derotatepoint(
lon :: Real,
lat :: Real,
geo :: GeoRegion;
rotation :: Real = 0
) -> X :: Real, Y :: Real
Derotate a coordinate point given by (lon,lat), around the centroid of the GeoRegion geo
, and return its X and Y cartesian positions in meters.
Arguments
lon
: The longitudinal coordinate of the pointlat
: The latitudinal coordinate of the pointgeo
: A GeoRegion.
Keyword Arguments
rotation
: Angle (in degrees) of rotation for the final "derotated" point about the GeoRegion centroid and projected into the X-Y cartesian coordinate system (in meters). A positive value relative togeo.θ
will turn the final values about the centroid in the anti-clockwise direction. Default is 0.
Returns
X
: A vector of X-coordinates (in meters) about the centroid for the shape of the GeoRegion.Y
: A vector of Y-coordinates (in meters) about the centroid for the shape of the GeoRegion.
derotatepoint(
pnt :: Point2{<:Real},
geo :: GeoRegion;
rotation :: Real = geo.θ
) -> X :: Real, Y :: Real
Derotate a coordinate point given by (lon,lat), around the centroid of the GeoRegion geo
, and return its X and Y cartesian positions in meters.
Arguments
pnt
: APoint2
type, containing the (lon,lat) coordinates.geo
: A GeoRegion.
Keyword Arguments
rotation
: Angle (in degrees) of rotation for the final "derotated" point about the GeoRegion centroid and projected into the X-Y cartesian coordinate system (in meters). A positive value relative togeo.θ
will turn the final values about the centroid in the anti-clockwise direction. Default is 0.
Returns
X
: A vector of X-coordinates (in meters) about the centroid for the shape of the GeoRegion.Y
: A vector of Y-coordinates (in meters) about the centroid for the shape of the GeoRegion.