![]() |
MapLink Pro 11.1.1.0.
Envitia MapLink Pro: The Ultimate Mapping Application Toolkit
|
Map Transform class.
A TSLCoordinateSystem object encapsulates the transforms used to create the map. It combines a datum, map projection and linear transform.
A TSLCoordinateSystem component obtained from a TSLMapDataLayer is only valid as long as no new map has been loaded into the layer since last obtaining the component.
If you wish to modify the settings on a standard TSLCoordinateSystem then you should clone the coordinate system first.
A TSLCoordinateSystem should only be shared between threads if the object is not modified (Do not change TMC per MU, offsets etc while the object is in use in multiple threads).
Iterating over, adding, creating or querying the TSLCoordinateSystems which are stored in the internal registries is not thread safe.
EPSG have changed the formula used for Transverse Mercator while retaining the EPSG IDs for the affected Coordinate Systems that use Transverse Mercator.
The original formula "USGS Snyder" and "JHS" formulas produce similar results in a ±4 degree band around the central longitude. Outside this band the results diverge. The JHS algorithm is more accurate out to ±40 degrees.
EPSG recommend that the two formulas are not mixed.
To address this change, a number of changes have been made to tsltransforms.dat that may affect an application. The changes are outlined below:
The functionality of the findByName() method has changed slightly.
When looking up a Coordinate System that uses Transverse Mercator projection the method expects one of two forms to be used:
"UTM (WGS84) Zone 1 North (Snyder)" "UTM (WGS84) Zone 1 North (JHS)"
For backwards compatibility the findByName() will return the original Coordinate System if "(Snyder)" or "(JHS)" is missing from the name being searched for. In this case a warning will be placed on the TSLThreadedErrorStack.
TSLCoordinateConvertor calls will also need to be updated to specify which formula to use.
NOTE: The Snyder formula is the formula used in MapLink 7.5 and older.
Public Types | |
enum | TSLTransverseMercatorFormula { TSLTransverseMercatorFormulaUSGS , TSLTransverseMercatorFormulaJHS } |
Public Member Functions | |
void | clearDatumTransform () |
void | clearLinearTransform () |
TSLCoordinateSystem * | clone (int id) const |
int | datumID () const |
const char * | datumName () const |
void | destroy () |
double | ellipsoidEccentricity () const |
double | ellipsoidMajorRadius () const |
double | ellipsoidMinorRadius () const |
const char * | ellipsoidName () const |
int | epsgID () const |
bool | isPolar () const |
bool | erase () |
const TSLTransformTraits * | getAllLinearParameters () const |
bool | getDatumSource (TSLSimpleString &source) const |
bool | getEllipsoidSource (TSLSimpleString &source) const |
void | getLinearPostTranslation (double *dx, double *dy) const |
void | getLinearPreTranslation (double *dx, double *dy) const |
double | getLinearRotation () const |
void | getLinearScaling (double *scaleX, double *scaleY) const |
void | getMapOffsets (double *xOffset, double *yOffset) const |
const TSLTransformTraits * | getMapProjectionParameters () const |
double | getProjectionFalseEasting () const |
double | getProjectionFalseNorthing () const |
void | getProjectionOrigin (double &latitude, double &longitude) const |
bool | getProjectionSource (TSLSimpleString &source) const |
bool | getReferenceDatumSource (TSLSimpleString &source) const |
bool | getSource (TSLSimpleString &source) const |
double | getTMCperMU () const |
int | id () const |
bool | latLongToMU (double latitude, double longitude, double *xMU, double *yMU, bool wrtReference=false) const |
bool | latLongToMU (int N, double *const latitudes, double *const longitudes, double *xMUs, double *yMUs, bool wrtReference=false) const |
bool | latLongToTMC (double latitude, double longitude, TSLTMC *xTMC, TSLTMC *yTMC, bool wrtReference=false) const |
bool | latLongToTMC (int N, double *const latitudes, double *const longitudes, TSLTMC *xTMCs, TSLTMC *yTMCs, bool wrtReference=false) const |
bool | MUToLatLong (double xMU, double yMU, double *latitude, double *longitude, bool wrtReference=false, bool boundCheck=true) const |
bool | MUToLatLong (int N, double *const xMUs, double *const yMUs, double *latitudes, double *longitudes, bool wrtReference=false, bool boundCheck=true) const |
bool | MUToTMC (double xMU, double yMU, TSLTMC *xTMC, TSLTMC *yTMC) const |
bool | MUToTMC (int N, double *const xMUs, double *const yMUs, TSLTMC *xTMCs, TSLTMC *yTMCs) const |
const char * | name () const |
double | projectionCentralLatitude () const |
double | projectionCentralMeridian () const |
const char * | projectionClassName () const |
const char * | projectionName () const |
int | referenceDatumID () const |
const char * | referenceDatumName () const |
bool | save (bool overwrite=false) |
bool | setDatumTransformCoordinateFrameRotation (double dX, double dY, double dZ, double rX, double rY, double rZ, double scaleFactor) |
bool | setDatumTransformGeocentricTranslation (double dX, double dY, double dZ) |
bool | setDatumTransformGeodeticOffset (double latitudeOffset, double longitudeOffset) |
bool | setDatumTransformPositionVector (double dX, double dY, double dZ, double rX, double rY, double rZ, double scaleFactor) |
bool | setLinearClientTransform (TSLClientLinearTransform *client) |
bool | setLinearPostTranslationTransform (double dx, double dy) |
bool | setLinearPreTranslationTransform (double dx, double dy) |
bool | setLinearRotationTransform (double rotation) |
bool | setLinearScalingTransform (double scaleX, double scaleY) |
void | setMapOffsets (double xOffset, double yOffset) |
bool | setProjectionAlbersEqualAreaConic (double phiS1, double phiS2, double latitude, double longitude) |
bool | setProjectionAzimuthalEquidistant (double latitude, double longitude) |
bool | setProjectionBonne (double phiS, double longitude) |
bool | setProjectionCassini (double latitude, double longitude) |
bool | setProjectionCylindricalEqualArea (double phiS, double longitude) |
bool | setProjectionEckertIV (double longitude) |
bool | setProjectionEckertVI (double longitude) |
bool | setProjectionEquidistantConic (double phiS1, double phiS2, double latitude, double longitude) |
bool | setProjectionEquidistantCylindrical (double phiS, double longitude) |
bool | setProjectionDynamicARC (double longitude) |
void | setProjectionFalseEasting (double falseEasting) |
void | setProjectionFalseNorthing (double falseNorthing) |
bool | setProjectionGnomonic (double latitude, double longitude) |
bool | setProjectionLambertAzimuthalEqualArea (double latitude, double longitude) |
bool | setProjectionLambertConformalConic (double phiS1, double phiS2, double latitude, double longitude) |
bool | setProjectionMercator (double longitude, double phiS=0.0) |
bool | setProjectionMiller (double longitude) |
bool | setProjectionMollweide (double longitude) |
bool | setProjectionObliqueCylindricalEqualArea_CentralLine (double latitudePt1, double longitudePt1, double latitudePt2, double longitudePt2, double scale) |
bool | setProjectionObliqueCylindricalEqualArea_CentralPoint (double latitude, double longitude, double azimuth, double scale) |
bool | setProjectionObliqueMercator_CentralLine (double latitudePt1, double longitudePt1, double latitudePt2, double longitudePt2, double latitude, double scale) |
bool | setProjectionObliqueMercator_CentralPoint (double latitude, double longitude, double azimuth, double scale, double rectifiedToSkewAngle) |
bool | setProjectionObliqueMercator_Hotine (double latitude, double longitude, double azimuth, double scale, double rectifiedToSkewAngle) |
void | setProjectionOrigin (double latitude, double longitude) |
bool | setProjectionOrthographic (double latitude, double longitude) |
bool | setProjectionPolyconic (double latitude, double longitude) |
bool | setProjectionSinusoidal (double longitude) |
bool | setProjectionStereographic (double latitude, double longitude, double scale=1.0) |
bool | setProjectionTransverseCylindricalEqualArea (double latitude, double longitude, double scale) |
bool | setProjectionTransverseMercator (double latitude, double longitude, double scale, TSLTransverseMercatorFormula formula) |
bool | setProjectionVanDerGrintenI (double longitude) |
bool | setReferenceDatumByID (int referenceDatumID) |
bool | setReferenceDatumByName (const char *referenceDatumName) |
void | setTMCperMU (double TMCperMU) |
TSLSimpleString | toWellKnownText () const |
bool | TMCToLatLong (TSLTMC xTMC, TSLTMC yTMC, double *latitude, double *longitude, bool wrtReference=false, bool boundCheck=true) const |
bool | TMCToLatLong (int N, TSLTMC *const xTMCs, TSLTMC *const yTMCs, double *latitudes, double *longitudes, bool wrtReference=false, bool boundCheck=true) const |
bool | TMCToMU (TSLTMC xTMC, TSLTMC yTMC, double *xMU, double *yMU) const |
bool | TMCToMU (int N, TSLTMC *const xTMCs, TSLTMC *const yTMCs, double *xMUs, double *yMUs) const |
const TSLTransformTraits * | getLinearPostTranslationParameters () const |
const TSLTransformTraits * | getLinearPreTranslationParameters () const |
const TSLTransformTraits * | getLinearRotationParameters () const |
const TSLTransformTraits * | getLinearScaleParameters () const |
bool | isLatLon () const |
bool | operator== (const TSLCoordinateSystem &otherCS) const |
Static Public Member Functions | |
static TSLCoordinateSystemIterator | begin () |
static TSLCoordinateSystem * | create (int id, const char *name, double semiMajorRadius, double eccentricity) |
static TSLCoordinateSystem * | createByDatumID (int id, const char *name, int datumID) |
static TSLCoordinateSystem * | createByDatumName (int id, const char *name, const char *datumName) |
static TSLCoordinateSystem * | createFromWellKnownText (const char *wkt) |
static double | eccentricity (double inverseFlattening) |
static TSLCoordinateSystemIterator | end () |
static const TSLCoordinateSystem * | findByEPSG (int id) |
static int | findByEPSG (int id, const TSLCoordinateSystem **coordinateSystems, int sizeOfCoordinateSystemArray) |
static const TSLCoordinateSystem * | findByID (int id) |
static const TSLCoordinateSystem * | findByName (const char *name) |
static double | inverseFlattening (double eccentricity) |
static bool | loadCoordinateSystems (const char *csysFile=0) |
static int | numberOfCoordinateSystems () |
static bool | saveCoordinateSystems (const char *csysFile) |
This enum represents the valid Transverse Mercator formulas.
The Snyder and JHS formulas are satisfactory within ±4° east or west of the longitude of origin.
The JHS formula is more robust and is satisfactory over ±40° of the longitude of origin.
The increasing distortions in distance, area and angle which are inherent in the Transverse Mercator projection as you move away from the origin cannot be avoided.
Outside the ±4° of longitude east or west of the projection longitude of origin, the Snyder and JHS formulas produce different results.
Enumerator | |
---|---|
TSLTransverseMercatorFormulaUSGS | USGS Snyder. |
TSLTransverseMercatorFormulaJHS | JHS. |
|
static |
Query method for loaded/created coordinate systems.
Returns an iterator to the beginning of the collection of coordinate systems.
void TSLCoordinateSystem::clearDatumTransform | ( | ) |
Removes the datum transform from this coordinate system.
void TSLCoordinateSystem::clearLinearTransform | ( | ) |
Removes the linear transform from this coordinate system.
TSLCoordinateSystem * TSLCoordinateSystem::clone | ( | int | id | ) | const |
Creates a writeable copy of a coordinate system.
id | The id of the cloned system. This MUST be positive. |
|
static |
Creates a user-defined coordinate system.
id | The id of the coordinate system. |
name | The name of the coordinate system. |
semiMajorRadius | The semi-major radius of the ellipsoid. |
eccentricity | The eccentricity of the ellipsoid. |
|
static |
Creates a user-defined coordinate system based on a pre-loaded datum id.
id | The id of the coordinate system. |
name | The name of the coordinate system. |
datumID | The id of the pre-loaded datum. |
|
static |
Creates a user-defined coordinate system based on a pre-loaded named datum.
id | The id of the coordinate system. |
name | The name of the coordinate system. |
datumName | The name of the pre-loaded datum. |
|
static |
Creates a new coordinate system object based on the Well Known Text coordinate definition provided.
Notes: Items created via this method cannot be added to the internal collection of all coordinate systems.
int TSLCoordinateSystem::datumID | ( | ) | const |
Returns the id of the datum associated with this coordinate system.
const char * TSLCoordinateSystem::datumName | ( | ) | const |
Returns the name of the datum associated with this coordinate system.
void TSLCoordinateSystem::destroy | ( | ) |
Deletes the coordinate system object. This method does not remove the coordinate system from the collection of all coordinate systems. To do that, use the 'erase' method.
|
static |
Returns the eccentricity of an ellipsoid given its inverse flattening.
inverseFlattening | The ellipsoid's inverse flattening. |
double TSLCoordinateSystem::ellipsoidEccentricity | ( | ) | const |
Returns the eccentricity of the ellipsoid associated with this coordinate system.
double TSLCoordinateSystem::ellipsoidMajorRadius | ( | ) | const |
Returns the major radius of the ellipsoid associated with this coordinate system.
double TSLCoordinateSystem::ellipsoidMinorRadius | ( | ) | const |
Returns the minor radius of the ellipsoid associated with this coordinate system.
const char * TSLCoordinateSystem::ellipsoidName | ( | ) | const |
Returns the name of the ellipsoid associated with this coordinate system.
|
static |
Query method for loaded/created coordinate systems.
Returns an iterator to one past the end of the collection of coordinate systems.
int TSLCoordinateSystem::epsgID | ( | ) | const |
Returns the EPSG id of the coordinate system.
bool TSLCoordinateSystem::erase | ( | ) |
Removes the coordinate system object from the collection of all coordinate systems. This method does not delete the object - use the 'destroy' method.
Returns true if successfully removed, false otherwise.
|
static |
Searches all loaded coordinate systems for the requested TSLCoordinateSystem with the specified EPSG id.
This method returns the first EPSG ID match.
Note: The introduction of alternative formulas for Transverse Mercator complicates the lookup of Coordinate Systems. Please see the class documentation.
id | The EPSG id of the coordinate system. |
|
static |
Searches all loaded coordinate systems for all the requested TSLCoordinateSystem with the specified EPSG id.
The method returns the TSLCoordinateSystems found in the array provided by the caller. If the array is too small the array is filled in the order that the matching TSLCoordinateSystem are found. If the array is too large the trailing entries are ignored.
The number of matching TSLCoordinateSystems is returned. This could be larger than the specified array.
Note: The introduction of alternative formulas for Transverse Mercator complicates the lookup of Coordinate Systems. Please see the class documentation.
id | The EPSG id of the coordinate system. |
coordinateSystems | Pointer to a user allocated array of pointers to TSLCoordinateSystem that is large enough to hold the requested matches. |
sizeOfCoordinateSystemArray | Specifies the size of the array of pointers. |
|
static |
Searches all loaded coordinate systems for the requested object.
Note: The introduction of alternative formulas for Transverse Mercator complicates the lookup of Coordinate Systems. Please see the class documentation.
id | The id of the coordinate system. |
|
static |
Searches all loaded coordinate systems for the requested object.
Note: The introduction of alternative formulas for Transverse Mercator complicates the lookup of Coordinate Systems. Please see the class documentation.
name | The name of the coordinate system. |
const TSLTransformTraits * TSLCoordinateSystem::getAllLinearParameters | ( | ) | const |
Returns a pointer to the map's total linear transformation parameter set.
Returns 0 if there is no associated linear transformation.
bool TSLCoordinateSystem::getDatumSource | ( | TSLSimpleString & | source | ) | const |
Returns the source for the Datum. The source may be a URN or a string which describes the origination of the Datum.
source | Storage for the Datum Source URN/string. |
bool TSLCoordinateSystem::getEllipsoidSource | ( | TSLSimpleString & | source | ) | const |
Returns the source for the Ellipsoid. The source may be a URN or a string which describes the origination of the Ellipsoid.
source | Storage for the Ellipsoid Source URN/string. |
void TSLCoordinateSystem::getLinearPostTranslation | ( | double * | dx, |
double * | dy ) const |
Query method for the linear post-translation parameters.
dx | A pointer to the post-translation along X (map units). |
dy | A pointer to the post-translation along Y (map units). |
const TSLTransformTraits * TSLCoordinateSystem::getLinearPostTranslationParameters | ( | ) | const |
Returns a pointer to the map's post-translation transform parameter set.
Returns 0 if there is no associated post-translation transform.
NOTE: if the map only has a pre-translation, this is equivalent to a post-translation. In this case, the associated parameter set is returned by this method rather than by the 'preTranslationParameters' method.
void TSLCoordinateSystem::getLinearPreTranslation | ( | double * | dx, |
double * | dy ) const |
Query method for the linear pre-translation parameters.
dx | A pointer to the post-translation along X (map units). |
dy | A pointer to the post-translation along Y (map units). |
const TSLTransformTraits * TSLCoordinateSystem::getLinearPreTranslationParameters | ( | ) | const |
Returns a pointer to the map's pre-translation transform parameter set.
Returns 0 if there is no associated pre-translation transform.
NOTE: if the map only has a pre-translation, this is equivalent to a post-translation. In this case, this method returns 0 but the parameter set will be returned by the 'postTranslationParameters' method.
double TSLCoordinateSystem::getLinearRotation | ( | ) | const |
Query method for the linear rotation parameter.
Returns the rotation angle in degrees.
const TSLTransformTraits * TSLCoordinateSystem::getLinearRotationParameters | ( | ) | const |
Returns a pointer to the map's rotation transform parameter set.
Returns 0 if there is no associated rotation transform.
const TSLTransformTraits * TSLCoordinateSystem::getLinearScaleParameters | ( | ) | const |
Returns a pointer to the map's scale transform parameter set.
Returns 0 if there is no associated scale transform.
void TSLCoordinateSystem::getLinearScaling | ( | double * | scaleX, |
double * | scaleY ) const |
Query method for the linear scaling parameters.
scaleX | A pointer to the scale factor in the X direction. |
scaleY | A pointer to the scale factor in the Y direction. |
void TSLCoordinateSystem::getMapOffsets | ( | double * | xOffset, |
double * | yOffset ) const |
Returns the origin of the MapLink TMC coordinate space wrt the projected map coordinate space (map units).
xOffset | Pointer to the x offset. |
yOffset | Pointer to the y offset. |
const TSLTransformTraits * TSLCoordinateSystem::getMapProjectionParameters | ( | ) | const |
Returns a pointer to the map projection's parameter set.
If there is no associated map projection, returns 0.
double TSLCoordinateSystem::getProjectionFalseEasting | ( | ) | const |
Returns the value of the false easting (map units) of this coordinate system's map projection.
double TSLCoordinateSystem::getProjectionFalseNorthing | ( | ) | const |
Returns the value of the false northing (map units) of this coordinate system's map projection.
void TSLCoordinateSystem::getProjectionOrigin | ( | double & | latitude, |
double & | longitude ) const |
Query the projection origin.
latitude | of the projection origin (degrees) |
longitude | of the projection origin (degrees) |
bool TSLCoordinateSystem::getProjectionSource | ( | TSLSimpleString & | source | ) | const |
Returns the source for the projection. The source may be a URN or a string which describes the origination of the projection.
source | Storage for the Projection Source URN/string. |
bool TSLCoordinateSystem::getReferenceDatumSource | ( | TSLSimpleString & | source | ) | const |
Returns the source for the Reference Datum. The source may be a URN or a string which describes the origination of the Datum.
source | Storage for the Reference Datum Source URN/string. |
bool TSLCoordinateSystem::getSource | ( | TSLSimpleString & | source | ) | const |
Returns the source for the coordinate system. The source may be a URN or a string which describes the origination of the coordinate system.
source | Storage for the Projection Source URN/string. |
double TSLCoordinateSystem::getTMCperMU | ( | ) | const |
Returns the number of TMC units per map unit.
int TSLCoordinateSystem::id | ( | ) | const |
Returns the id of the coordinate system.
|
static |
Returns the inverseFlattening an ellipsoid given its eccentricity.
eccentricity | The ellipsoid's eccentricity. |
bool TSLCoordinateSystem::isLatLon | ( | ) | const |
Query whether this coordinate transform is lat/long compatible i.e 1 MU == 1 degree
This method will return true for at least:
If this method returns false the coordinate system does not use degrees. It is safe to assume the coordinate system is in Meters if this method returns false however this is not guaranteed.
If the coordinate system has a linear transform or scaling it is ignored by this method. This may result in a situation where the coordinate system uses degrees but 1 MU is not equal to 1 Degree.
bool TSLCoordinateSystem::isPolar | ( | ) | const |
Returns whether coordinate system has the polar flag set
bool TSLCoordinateSystem::latLongToMU | ( | double | latitude, |
double | longitude, | ||
double * | xMU, | ||
double * | yMU, | ||
bool | wrtReference = false ) const |
Projects the supplied geodetic latitude and longitude into the map coordinate space.
latitude | The latitude. |
longitude | The longitude. |
xMU | Pointer to the projected x-coordinate. |
yMU | Pointer to the projected y-coordinate. |
wrtReference | if true, then the latitude and longitude are given wrt the reference datum (default WGS 1984); if false (default), then the latitude and longitude are given wrt the coordinate system's local datum. |
bool TSLCoordinateSystem::latLongToMU | ( | int | N, |
double *const | latitudes, | ||
double *const | longitudes, | ||
double * | xMUs, | ||
double * | yMUs, | ||
bool | wrtReference = false ) const |
Projects the supplied array of geodetic latitude and longitude points into the map coordinate space.
N | the number of points in each array. |
latitudes | Pointer to the array of latitudes. |
longitudes | Pointer to the array of longitudes. |
xMUs | Pointer to the array of projected x-coordinates. |
yMUs | Pointer to the array of projected y-coordinates. |
wrtReference | if true, then the latitude and longitude are given wrt the reference datum (default WGS 1984); if false (default), then the latitude and longitude are given wrt the coordinate system's local datum. |
bool TSLCoordinateSystem::latLongToTMC | ( | double | latitude, |
double | longitude, | ||
TSLTMC * | xTMC, | ||
TSLTMC * | yTMC, | ||
bool | wrtReference = false ) const |
Projects the supplied geodetic latitude and longitude into the MapLink coordinate space.
latitude | The latitude. |
longitude | The longitude. |
xTMC | Pointer to the TMC x-coordinate. |
yTMC | Pointer to the TMC y-coordinate. |
wrtReference | if true, then the latitude and longitude are given wrt the reference datum (default WGS 1984); if false (default), then the latitude and longitude are given wrt the coordinate system's local datum. |
bool TSLCoordinateSystem::latLongToTMC | ( | int | N, |
double *const | latitudes, | ||
double *const | longitudes, | ||
TSLTMC * | xTMCs, | ||
TSLTMC * | yTMCs, | ||
bool | wrtReference = false ) const |
Projects the supplied array of geodetic latitude and longitude points into the MapLink coordinate space.
N | the number of points in each array. |
latitudes | Pointer to the array of latitudes. |
longitudes | Pointer to the array of longitudes. |
xTMCs | Pointer to the array of TMC x-coordinates. |
yTMCs | Pointer to the array of TMC y-coordinates. |
wrtReference | if true, then the latitude and longitude are given wrt the reference datum (default WGS 1984); if false (default), then the latitude and longitude are given wrt the coordinate system's local datum. |
|
static |
Loads the coordinate systems that are supplied as part of the Maplink distribution.
If MapLink is installed on the system running the application calling this method, then it is valid to not pass a csysFile parameter. If MapLink is not installed however, the csysFile parameter should be provided. It should contain the path to the coordinate systems definition file; for instance the 'tsltransforms.dat' contained in the config directory of a MapLink installation.
csysFile | A pointer to the name of the file containing the definitions of the coordinate systems. If this is 0, then the standard MapLink home directory will be searched for the definitions file. |
bool TSLCoordinateSystem::MUToLatLong | ( | double | xMU, |
double | yMU, | ||
double * | latitude, | ||
double * | longitude, | ||
bool | wrtReference = false, | ||
bool | boundCheck = true ) const |
Projects the supplied map x and y coordinate back into the geodetic coordinate space.
xMU | The map x-coordinate. |
yMU | The map y-coordinate. |
latitude | Pointer to the latitude. |
longitude | Pointer to the longitude. |
wrtReference | if true, then the latitude and longitude are given wrt the reference datum (default WGS 1984); if false (default), then the latitude and longitude are given wrt the coordinate system's local datum. |
boundCheck | When the initial coordinates are outside of the map extent, the returned latitude/longitude could be invalid. When this flag is true (default), a check for invalid results is performed. This check will double the processing time required by the method, but return a validated status code. If the specified coordinate is guaranteed to be within the map extent, then this flag may be turned off. |
bool TSLCoordinateSystem::MUToLatLong | ( | int | N, |
double *const | xMUs, | ||
double *const | yMUs, | ||
double * | latitudes, | ||
double * | longitudes, | ||
bool | wrtReference = false, | ||
bool | boundCheck = true ) const |
Projects the supplied array of map x and y coordinates back into the geodetic coordinate space.
N | the number of points in each array. |
xMUs | Pointer to the array of map x-coordinates. |
yMUs | Pointer to the array of map y-coordinates. |
latitudes | Pointer to the array of latitudes. |
longitudes | Pointer to the array of longitudes. |
wrtReference | if true, then the latitude and longitude are given wrt the reference datum (default WGS 1984); if false (default), then the latitude and longitude are given wrt the coordinate system's local datum. |
boundCheck | When the initial coordinates are outside of the map extent, the returned latitude/longitude could be invalid. When this flag is true (default), a check for invalid results is performed. This check will double the processing time required by the method, but return a validated status code. If the specified coordinate is guaranteed to be within the map extent, then this flag may be turned off. |
bool TSLCoordinateSystem::MUToTMC | ( | double | xMU, |
double | yMU, | ||
TSLTMC * | xTMC, | ||
TSLTMC * | yTMC ) const |
Converts the supplied map x and y coordinate into the MapLink coordinate space.
xMU | The map x-coordinate. |
yMU | The map y-coordinate. |
xTMC | Pointer to the TMC x-coordinate. |
yTMC | Pointer to the TMC y-coordinate. |
bool TSLCoordinateSystem::MUToTMC | ( | int | N, |
double *const | xMUs, | ||
double *const | yMUs, | ||
TSLTMC * | xTMCs, | ||
TSLTMC * | yTMCs ) const |
Converts the supplied array of map x and y coordinates into the MapLink coordinate space.
N | the number of points in each array. |
xMUs | Pointer to the array of map x-coordinates. |
yMUs | Pointer to the array of map y-coordinates. |
xTMCs | Pointer to the array of TMC x-coordinates. |
yTMCs | Pointer to the array of TMC y-coordinates. |
const char * TSLCoordinateSystem::name | ( | ) | const |
Returns the name of the coordinate system.
|
static |
Returns the number of coordinate systems currently loaded.
bool TSLCoordinateSystem::operator== | ( | const TSLCoordinateSystem & | otherCS | ) | const |
Equality operator
double TSLCoordinateSystem::projectionCentralLatitude | ( | ) | const |
Returns the latitude origin of this coordinate system's map projection.
double TSLCoordinateSystem::projectionCentralMeridian | ( | ) | const |
Returns the longitude origin of this coordinate system's map projection.
const char * TSLCoordinateSystem::projectionClassName | ( | ) | const |
Returns the name of the class of projection associated with this coordinate system (e.g. "Mercator").
const char * TSLCoordinateSystem::projectionName | ( | ) | const |
Returns the name of the projection associated with this coordinate system.
int TSLCoordinateSystem::referenceDatumID | ( | ) | const |
Returns the id of the reference datum associated with this coordinate system.
const char * TSLCoordinateSystem::referenceDatumName | ( | ) | const |
Returns the name of the reference datum associated with this coordinate system.
bool TSLCoordinateSystem::save | ( | bool | overwrite = false | ) |
Saves a user-defined coordinate system to the collection of all coordinate systems. This does not overwrite coordinate systems that already exist with the same id (unless overwrite is set to true). In such cases, use 'erase' first to remove the system from the collection.
overwrite | If set to 'true', then will overwrite coordinate systems that already exist with the same id. Default is false. |
|
static |
Saves any coordinate systems that the user has defined.
csysFile | The name of the file which will contain the definitions of the coordinate systems. |
bool TSLCoordinateSystem::setDatumTransformCoordinateFrameRotation | ( | double | dX, |
double | dY, | ||
double | dZ, | ||
double | rX, | ||
double | rY, | ||
double | rZ, | ||
double | scaleFactor ) |
Assigns a datum transform based on Coordinate Frame Rotation parameters to this coordinate system.
dX | The X-shift from local datum to reference datum in XYZ space. |
dY | The Y-shift from local datum to reference datum in XYZ space. |
dZ | The Z-shift from local datum to reference datum in XYZ space. |
rX | The X-rotation from local datum to reference datum in XYZ space (arc-seconds). |
rY | The Y-rotation from local datum to reference datum in XYZ space (arc-seconds). |
rZ | The Z-rotation from local datum to reference datum in XYZ space (arc-seconds). |
scaleFactor | The scale correction factor (parts-per-million). |
bool TSLCoordinateSystem::setDatumTransformGeocentricTranslation | ( | double | dX, |
double | dY, | ||
double | dZ ) |
Assigns a datum transform based on Geocentric Translation parameters to this coordinate system.
dX | The X-shift from local datum to reference datum in XYZ space. |
dY | The Y-shift from local datum to reference datum in XYZ space. |
dZ | The Z-shift from local datum to reference datum in XYZ space. |
bool TSLCoordinateSystem::setDatumTransformGeodeticOffset | ( | double | latitudeOffset, |
double | longitudeOffset ) |
Assigns a datum transform based on Geodetic Offset parameters to this coordinate system.
latitudeOffset | The latitude shift from local datum to reference datum (arc-seconds). |
longitudeOffset | The longitude shift from local datum to reference datum (arc-seconds). |
bool TSLCoordinateSystem::setDatumTransformPositionVector | ( | double | dX, |
double | dY, | ||
double | dZ, | ||
double | rX, | ||
double | rY, | ||
double | rZ, | ||
double | scaleFactor ) |
Assigns a datum transform based on Position Vector parameters to this coordinate system.
dX | The X-shift from local datum to reference datum in XYZ space. |
dY | The Y-shift from local datum to reference datum in XYZ space. |
dZ | The Z-shift from local datum to reference datum in XYZ space. |
rX | The X-rotation from local datum to reference datum in XYZ space (arc-seconds). |
rY | The Y-rotation from local datum to reference datum in XYZ space (arc-seconds). |
rZ | The Z-rotation from local datum to reference datum in XYZ space (arc-seconds). |
scaleFactor | The scale correction factor (parts-per-million). |
bool TSLCoordinateSystem::setLinearClientTransform | ( | TSLClientLinearTransform * | client | ) |
Assigns a client linear transform to this coordinate system. The linear transform process chain is: pre-translation, scale, rotate and post-translate followed by the client transform.
client | The client transform. |
bool TSLCoordinateSystem::setLinearPostTranslationTransform | ( | double | dx, |
double | dy ) |
Assigns a pre-translation transform to this coordinate system. The linear transform process chain is: pre-translation, scale, rotate and post-translate.
dx | The post-translation along X (map units). |
dy | The post-translation along Y (map units). |
bool TSLCoordinateSystem::setLinearPreTranslationTransform | ( | double | dx, |
double | dy ) |
Assigns a pre-translation transform to this coordinate system. The linear transform process chain is: pre-translation, scale, rotate and post-translate.
dx | The pre-translation along X (map units). |
dy | The pre-translation along Y (map units). |
bool TSLCoordinateSystem::setLinearRotationTransform | ( | double | rotation | ) |
Assigns a rotation transform to this coordinate system. The linear transform process chain is: pre-translation, scale, rotate and post-translate.
rotation | The rotation angle (degrees). |
bool TSLCoordinateSystem::setLinearScalingTransform | ( | double | scaleX, |
double | scaleY ) |
Assigns a scale transform to this coordinate system. The linear transform process chain is: pre-translation, scale, rotate and post-translate.
scaleX | The scale factor in the X direction. |
scaleY | The scale factor in the Y direction. |
void TSLCoordinateSystem::setMapOffsets | ( | double | xOffset, |
double | yOffset ) |
Sets the origin of the MapLink TMC coordinate space wrt the projected map coordinate space (map units).
xOffset | The map x offset (map units). |
yOffset | The map y offset (map units). |
bool TSLCoordinateSystem::setProjectionAlbersEqualAreaConic | ( | double | phiS1, |
double | phiS2, | ||
double | latitude, | ||
double | longitude ) |
Assigns an Albers Equal-Area map projection to this coordinate system.
phiS1 | The first standard parallel (degrees). |
phiS2 | The second standard parallel (degrees). |
latitude | The central latitude of the projection (degrees). |
longitude | The central meridian of the projection (degrees). |
bool TSLCoordinateSystem::setProjectionAzimuthalEquidistant | ( | double | latitude, |
double | longitude ) |
Assigns an Azimuthal Equidistant map projection to this coordinate system.
latitude | The central latitude (degrees). |
longitude | The central meridian of the projection (degrees). |
bool TSLCoordinateSystem::setProjectionBonne | ( | double | phiS, |
double | longitude ) |
Assigns a Bonne map projection to this coordinate system.
phiS | The standard parallel (degrees). |
longitude | The central meridian of the projection (degrees). |
bool TSLCoordinateSystem::setProjectionCassini | ( | double | latitude, |
double | longitude ) |
Assigns a Cassini map projection to this coordinate system.
latitude | The central latitude (degrees). |
longitude | The central meridian of the projection (degrees). |
bool TSLCoordinateSystem::setProjectionCylindricalEqualArea | ( | double | phiS, |
double | longitude ) |
Assigns a Cylindrical Equal-Area map projection to this coordinate system.
phiS | The standard parallel (degrees). |
longitude | The central meridian of the projection (degrees). |
bool TSLCoordinateSystem::setProjectionDynamicARC | ( | double | longitude | ) |
Assigns a Dynamic ARC map projection to this coordinate system.
longitude | The central meridian of the projection (degrees). |
bool TSLCoordinateSystem::setProjectionEckertIV | ( | double | longitude | ) |
Assigns an Eckert IV map projection to this coordinate system.
longitude | The central meridian of the projection (degrees). |
bool TSLCoordinateSystem::setProjectionEckertVI | ( | double | longitude | ) |
Assigns an Eckert VI map projection to this coordinate system.
longitude | The central meridian of the projection (degrees). |
bool TSLCoordinateSystem::setProjectionEquidistantConic | ( | double | phiS1, |
double | phiS2, | ||
double | latitude, | ||
double | longitude ) |
Assigns an Equidistant Conic map projection to this coordinate system.
phiS1 | The first standard parallel (degrees). |
phiS2 | The second standard parallel (degrees). |
latitude | The central latitude of the projection (degrees). |
longitude | The central meridian of the projection (degrees). |
bool TSLCoordinateSystem::setProjectionEquidistantCylindrical | ( | double | phiS, |
double | longitude ) |
Assigns an Equidistant Cylindrical map projection to this coordinate system.
phiS | The standard parallel (degrees). |
longitude | The central meridian of the projection (degrees). |
void TSLCoordinateSystem::setProjectionFalseEasting | ( | double | falseEasting | ) |
Sets the value of the false easting of this coordinate system's map projection.
NOTE : The main projection parameters need to be configured before this value, otherwise the Map Unit values will be incorrect.
falseEasting | The false easting (map units). |
void TSLCoordinateSystem::setProjectionFalseNorthing | ( | double | falseNorthing | ) |
Sets the value of the false northing of this coordinate system's map projection.
NOTE : The main projection parameters need to be configured before this value, otherwise the Map Unit values will be incorrect.
falseNorthing | The false easting (map units). |
bool TSLCoordinateSystem::setProjectionGnomonic | ( | double | latitude, |
double | longitude ) |
Assigns a Gnomonic map projection to this coordinate system.
latitude | The central latitude of the projection (degrees). |
longitude | The central meridian of the projection (degrees). |
bool TSLCoordinateSystem::setProjectionLambertAzimuthalEqualArea | ( | double | latitude, |
double | longitude ) |
Assigns a Lambert Azimuthal Equal-Area map projection to this coordinate system.
latitude | The central latitude of the projection (degrees). |
longitude | The central meridian of the projection (degrees). |
bool TSLCoordinateSystem::setProjectionLambertConformalConic | ( | double | phiS1, |
double | phiS2, | ||
double | latitude, | ||
double | longitude ) |
Assigns a Lambert Conformal Conic map projection to this coordinate system.
phiS1 | The first standard parallel (degrees). |
phiS2 | The second standard parallel (degrees). |
latitude | The central latitude of the projection (degrees). |
longitude | The central meridian of the projection (degrees). |
bool TSLCoordinateSystem::setProjectionMercator | ( | double | longitude, |
double | phiS = 0.0 ) |
Assigns a Mercator map projection to this coordinate system.
longitude | The central meridian of the projection (degrees). |
phiS | The standard parallel (degrees) - default = 0.0 (the Equator). |
bool TSLCoordinateSystem::setProjectionMiller | ( | double | longitude | ) |
Assigns a Miller map projection to this coordinate system.
longitude | The central meridian of the projection (degrees). |
bool TSLCoordinateSystem::setProjectionMollweide | ( | double | longitude | ) |
Assigns a Mollweide map projection to this coordinate system.
longitude | The central meridian of the projection (degrees). |
bool TSLCoordinateSystem::setProjectionObliqueCylindricalEqualArea_CentralLine | ( | double | latitudePt1, |
double | longitudePt1, | ||
double | latitudePt2, | ||
double | longitudePt2, | ||
double | scale ) |
Assigns an Oblique Cylindrical Equal-Area map projection (based on a central line) to this coordinate system.
latitudePt1 | The latitude of the first reference point defining the central line of the projection (degrees). |
longitudePt1 | The longitude of the first reference point defining the central line of the projection (degrees). |
latitudePt2 | The latitude of the second reference point defining the central line of the projection (degrees). |
longitudePt2 | The longitude of the second reference point defining the central line of the projection (degrees). |
scale | The scale factor along the central line. |
bool TSLCoordinateSystem::setProjectionObliqueCylindricalEqualArea_CentralPoint | ( | double | latitude, |
double | longitude, | ||
double | azimuth, | ||
double | scale ) |
Assigns an Oblique Cylindrical Equal-Area map projection (based on a central point) to this coordinate system.
latitude | The latitude of the central point of the projection (degrees). |
longitude | The longitude of the central point of the projection (degrees). |
azimuth | The azimuth, east of north, of the central line through the central point of the projection (degrees). |
scale | The scale factor along the central line. |
bool TSLCoordinateSystem::setProjectionObliqueMercator_CentralLine | ( | double | latitudePt1, |
double | longitudePt1, | ||
double | latitudePt2, | ||
double | longitudePt2, | ||
double | latitude, | ||
double | scale ) |
Assigns an Oblique Mercator map projection (based on a central line) to this coordinate system.
latitudePt1 | The latitude of the first reference point defining the central line of the projection (degrees). |
longitudePt1 | The longitude of the first reference point defining the central line of the projection (degrees). |
latitudePt2 | The latitude of the second reference point defining the central line of the projection (degrees). |
longitudePt2 | The longitude of the second reference point defining the central line of the projection (degrees). |
latitude | The latitude of the centre of the map (degrees). |
scale | The scale factor along the central line. |
bool TSLCoordinateSystem::setProjectionObliqueMercator_CentralPoint | ( | double | latitude, |
double | longitude, | ||
double | azimuth, | ||
double | scale, | ||
double | rectifiedToSkewAngle ) |
Assigns an Oblique Mercator map projection (based on a central point) to this coordinate system.
latitude | The latitude of the central point of the projection (degrees). |
longitude | The longitude of the central point of the projection (degrees). |
azimuth | The azimuth, east of north, of the central line through the central point of the projection (degrees). |
scale | The scale factor along the central line. |
rectifiedToSkewAngle | The angle from the rectified grid to the skew (oblique) grid (degrees). |
bool TSLCoordinateSystem::setProjectionObliqueMercator_Hotine | ( | double | latitude, |
double | longitude, | ||
double | azimuth, | ||
double | scale, | ||
double | rectifiedToSkewAngle ) |
Assigns an Oblique Hotine Mercator map projection (based on a central point) to this coordinate system.
latitude | The latitude of the central point of the projection (degrees). |
longitude | The longitude of the central point of the projection (degrees). |
azimuth | The azimuth, east of north, of the central line through the central point of the projection (degrees). |
scale | The scale factor along the central line. |
rectifiedToSkewAngle | The angle from the rectified grid to the skew (oblique) grid (degrees). |
void TSLCoordinateSystem::setProjectionOrigin | ( | double | latitude, |
double | longitude ) |
Sets the origin of this coordinate system's map projection.
latitude | The central latitude (degrees). |
longitude | The central meridian (degrees). |
bool TSLCoordinateSystem::setProjectionOrthographic | ( | double | latitude, |
double | longitude ) |
Assigns an Orthographic map projection to this coordinate system.
latitude | The central latitude of the projection (degrees). |
longitude | The central meridian of the projection (degrees). |
bool TSLCoordinateSystem::setProjectionPolyconic | ( | double | latitude, |
double | longitude ) |
Assigns a Polyconic map projection to this coordinate system.
latitude | The central meridian of the projection (degrees). |
longitude | The central meridian of the projection (degrees). |
bool TSLCoordinateSystem::setProjectionSinusoidal | ( | double | longitude | ) |
Assigns a Sinusoidal map projection to this coordinate system.
longitude | The central meridian of the projection (degrees). |
bool TSLCoordinateSystem::setProjectionStereographic | ( | double | latitude, |
double | longitude, | ||
double | scale = 1.0 ) |
Assigns a Stereographic map projection to this coordinate system.
latitude | The central latitude of the projection (degrees). |
longitude | The central meridian of the projection (degrees). |
scale | The scale factor at the pole (default =1). |
bool TSLCoordinateSystem::setProjectionTransverseCylindricalEqualArea | ( | double | latitude, |
double | longitude, | ||
double | scale ) |
Assigns a Transverse Cylindrical Equal-Area map projection to this coordinate system.
latitude | The central latitude of the projection (degrees). |
longitude | The central meridian of the projection (degrees). |
scale | The scale factor on the central meridian. |
bool TSLCoordinateSystem::setProjectionTransverseMercator | ( | double | latitude, |
double | longitude, | ||
double | scale, | ||
TSLTransverseMercatorFormula | formula ) |
Assigns a Transverse Mercator map projection to this coordinate system.
There are two Transverse Mercator formulas; USGS (Snyder) and JHS formulas.
The Snyder and JHS formulas are satisfactory within ±4° east or west of the longitude of origin.
The JHS formula is more robust and is satisfactory over ±40° of the longitude of origin.
The increasing distortions in distance, area and angle which are inherent in the Transverse Mercator projection as you move away from the origin cannot be avoided.
Note:
latitude | The central latitude of the projection (degrees). |
longitude | The central meridian of the projection (degrees). |
scale | The scale factor on the central meridian. |
formula | The Transverse Mercator algorithm to use. |
bool TSLCoordinateSystem::setProjectionVanDerGrintenI | ( | double | longitude | ) |
Assigns a van der Grinten map projection to this coordinate system.
longitude | The central meridian of the projection (degrees). |
bool TSLCoordinateSystem::setReferenceDatumByID | ( | int | referenceDatumID | ) |
Assigns a pre-loaded reference datum to this coordinate system and attaches a datum transform between the coordinate system's local datum and the reference datum.
referenceDatumID | The id of the reference datum. |
bool TSLCoordinateSystem::setReferenceDatumByName | ( | const char * | referenceDatumName | ) |
Assigns a pre-loaded reference datum to this coordinate system and attaches a datum transform between the coordinate system's local datum and the reference datum.
referenceDatumName | The name of the reference datum. |
void TSLCoordinateSystem::setTMCperMU | ( | double | TMCperMU | ) |
Sets the number of TMC units per map unit.
NOTE : This value is currently ignored when the coordinate system is used for run-time projection. Under those circumstances the TMCperMU is calculated according to the input data extent.
TMCperMU | The number of TMC units per map unit. |
bool TSLCoordinateSystem::TMCToLatLong | ( | int | N, |
TSLTMC *const | xTMCs, | ||
TSLTMC *const | yTMCs, | ||
double * | latitudes, | ||
double * | longitudes, | ||
bool | wrtReference = false, | ||
bool | boundCheck = true ) const |
Projects the supplied array of MapLink x and y TMC units back into the geodetic coordinate space.
N | the number of points in each array. |
xTMCs | Pointer to the array of TMC x-coordinates. |
yTMCs | Pointer to the array of TMC y-coordinates. |
latitudes | Pointer to the array of latitudes. |
longitudes | Pointer to the array of longitudes. |
wrtReference | if true, then the latitude and longitude are given wrt the reference datum (default WGS 1984); if false (default), then the latitude and longitude are given wrt the coordinate system's local datum. |
boundCheck | When the initial coordinates are outside of the map extent, the returned latitude/longitude could be invalid. When this flag is true (default), a check for invalid results is performed. This check will double the processing time required by the method, but return a validated status code. If the specified coordinate is guaranteed to be within the map extent, then this flag may be turned off. |
bool TSLCoordinateSystem::TMCToLatLong | ( | TSLTMC | xTMC, |
TSLTMC | yTMC, | ||
double * | latitude, | ||
double * | longitude, | ||
bool | wrtReference = false, | ||
bool | boundCheck = true ) const |
Projects the supplied MapLink x and y TMC unit back into the geodetic coordinate space.
xTMC | The TMC x-coordinate. |
yTMC | The TMC y-coordinate. |
latitude | Pointer to the latitude. |
longitude | Pointer to the longitude. |
wrtReference | if true, then the latitude and longitude are given wrt the reference datum (default WGS 1984); if false (default), then the latitude and longitude are given wrt the coordinate system's local datum. |
boundCheck | When the initial coordinates are outside of the map extent, the returned latitude/longitude could be invalid. When this flag is true (default), a check for invalid results is performed. This check will double the processing time required by the method, but return a validated status code. If the specified coordinate is guaranteed to be within the map extent, then this flag may be turned off. |
bool TSLCoordinateSystem::TMCToMU | ( | int | N, |
TSLTMC *const | xTMCs, | ||
TSLTMC *const | yTMCs, | ||
double * | xMUs, | ||
double * | yMUs ) const |
Converts the supplied array of MapLink x ad y TMC units into the map coordinate space.
N | the number of points in each array. |
xTMCs | Pointer to the array of TMC x-coordinates. |
yTMCs | Pointer to the array of TMC y-coordinates. |
xMUs | Pointer to the array of map x-coordinates. |
yMUs | Pointer to the array of map y-coordinates. |
bool TSLCoordinateSystem::TMCToMU | ( | TSLTMC | xTMC, |
TSLTMC | yTMC, | ||
double * | xMU, | ||
double * | yMU ) const |
Converts the supplied MapLink x ad y TMC unit into the map coordinate space.
xTMC | The TMC x-coordinate. |
yTMC | The TMC y-coordinate. |
xMU | Pointer to the map x-coordinate. |
yMU | Pointer to the map y-coordinate. |
TSLSimpleString TSLCoordinateSystem::toWellKnownText | ( | ) | const |
Returns this coordinate system object as Well Known Text.