CanvasMap
Getting Started Tutorials 3D Reference

Class CMProjector extends CMBase

CMProjector Base class.
This class defines the main functions for projectors to convert between projected and
geographic coordinates.

This class also provides a projector that can be used to keep geographic data as geographic
data. In otherwords, it does not touch the data and assumes the data is in geographic. This
allows it to work with layers like the graticule layer.


Copyright (C) 2020, Humboldt State University, Jim Graham

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General
Public License as published by the Free Software Foundation, either version 3 of the License, or (at your
option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see
.

Static Functions

ReturnsFunctionThrows
angle DegreesToRadians(-)
angle RadiansToDegrees(-)

Object Functions

Inherited From: CMBase
ReturnsFunctionThrows
ProjectToGeographic(Easting, Northing, Elevation)
ProjectFromGeographic(Longitude, Latitude, Elevation)
GetClippingPolys()
An ProjectPolyFromGeographic(ThePoly)
An ProjectAreaFromGeographic(TheArea, TheType)
An ProjectRegionFromGeographic(TheRegion, TheType)
An ProjectRegionsFromGeographic(TheRegion, TheType)

Static Functions

angle=DegreesToRadians(-)

Convert an angle in degrees to radians

Parameters:
    - DegreeAngle

Returns: angle - in radians

angle=RadiansToDegrees(-)

Convert an angle in radians to degrees

Parameters:
    - RadianAngle

Returns: angle - in degrees

Object Functions

ProjectToGeographic(Easting, Northing, Elevation)

Primary function to convert from a projected coordinate to geographic
@override

Parameters:
    Easting - east-west projected coordinate value
    Northing - north-south projected coordinate value
    Elevation - vertical coordinate value in meters

ProjectFromGeographic(Longitude, Latitude, Elevation)

Primary function to convert from a projected system to geographic
@override

Parameters:
    Longitude - east-west geographic coordinate value
    Latitude - north-south geographic coordinate value
    Elevation - vertical coordinate value in meters

GetClippingPolys()

Return the clipping polygons in geographic coordinates for the projection.
Override to provide clipping to keep geometries correct for projections.
No longer gets called
@override

An=ProjectPolyFromGeographic(ThePoly)

Override to provide clipping to keep geometries correct for projections.
@override

Parameters:
    ThePoly - Array of two dimensions, ThePoly[0]=Xs[] and ThePoly[1]=Ys[], optionally, ThePoly[2]=Zs[]

Returns: An - array with the new Xs, Ys, and Zs.

An=ProjectAreaFromGeographic(TheArea, TheType)

Projects an Area, an array of polys, to geographic.
@override

Parameters:
    TheArea - Array of polygons (2D or 3D)
    TheType - CMDatasetVector.TYPE_POINTS, CMDatasetVector.TYPE_POLYLINES, or CMDatasetVector.TYPE_POLYGONS,

Returns: An - array of new polys

An=ProjectRegionFromGeographic(TheRegion, TheType)

Projects a Region, an array of areas, to geographic.
@override

Parameters:
    TheRegion - Array of Areas (2D or 3D)
    TheType - CMDatasetVector.TYPE_POINTS, CMDatasetVector.TYPE_POLYLINES, or CMDatasetVector.TYPE_POLYGONS,

Returns: An - array of new Areas

An=ProjectRegionsFromGeographic(TheRegion, TheType)

Projects an array of Regions to geographic. This is the same as the spatial data
for a single feature.
@override

Parameters:
    TheRegion - Array of Regions (2D or 3D)
    TheType - CMDatasetVector.TYPE_POINTS, CMDatasetVector.TYPE_POLYLINES, or CMDatasetVector.TYPE_POLYGONS,

Returns: An - array of new Regions