Skip to content

API for Derotations

Derotating a Shape

GeoRegions.derotatecoordinates Function
julia
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 : A Vector containing the longitudes of the points.

  • lat : A Vector 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 to geo.θ 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.

source
julia
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 : A Vector of Point2 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 to geo.θ 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.

source
GeoRegions.derotatecoordinates! Function
julia
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 : A Vector containing the longitudes of the points, values will be replaced by the derotated x-coordinates (in meters) about the centroid.

  • lat : A Vector 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 to geo.θ will turn the final values about the centroid in the anti-clockwise direction. Default is 0.
source

Derotating a Point Coordinate

GeoRegions.derotatepoint Function
julia
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 point

  • lat : The latitudinal coordinate of the point

  • 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 to geo.θ 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.

source
julia
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 : A Point2 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 to geo.θ 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.

source