CartoType API
Public Member Functions | Protected Member Functions | Protected Attributes
CartoType::TMercator Class Reference

#include <cartotype_mercator.h>

Inheritance diagram for CartoType::TMercator:
CartoType::TProjectionUsingFloatingPoint CartoType::TCoordinateTransform CartoType::TMillerCylindrical

List of all members.

Public Member Functions

CT_IMPORT TMercator (const TMercatorParam &aParam)
CT_IMPORT TResult Inverse (const TPoint &aInput, TPoint &aOutput) const
CT_IMPORT TResult Read (TDataInputStream &aInput)
CT_IMPORT TResult Write (TDataOutputStream &aOutput) const
CT_IMPORT TCoordinateTransformCopy (TResult &aError) const

Protected Member Functions

CT_IMPORT void ProjectHelper (const TPoint &aInput, double &aX, double &aY) const

Protected Attributes

double iPrimeMeridian

Detailed Description

A plain spherical Mercator projection.

This projection uses floating-point arithmetic and is therefore not suitable for use on platforms with slow floating-point arithmetic.

This class is derived from TCoordinateTransform, not TProjection, to save unnecessary fixed-point arithmetic.


Member Function Documentation

CT_EXPORT TCoordinateTransform * TMercator::Copy ( TResult aError) const [virtual]

Create an exact copy of this object.

Implements CartoType::TCoordinateTransform.

Reimplemented in CartoType::TMillerCylindrical.

CT_EXPORT TResult TMercator::Inverse ( const TPoint aInput,
TPoint aOutput 
) const [virtual]

Convert Mercator-projection map metres to latitude and longitude. The Mercator projection formula is from http://en.wikipedia.org/wiki/Mercator_projection.

Implements CartoType::TCoordinateTransform.

Reimplemented in CartoType::TMillerCylindrical.

CT_EXPORT void TMercator::ProjectHelper ( const TPoint aInput,
double &  aX,
double &  aY 
) const [protected, virtual]

Project points to double-precision floating point pixels without applying the final transform. The Mercator projection formula is from http://en.wikipedia.org/wiki/Mercator_projection. To avoid infinities and excessively large coordinates latitudes are clamped to 85.05113 degrees, giving a square map because the maximum transformed latitude value is pi.

Implements CartoType::TProjectionUsingFloatingPoint.

Reimplemented in CartoType::TMillerCylindrical.

CT_EXPORT TResult TMercator::Read ( TDataInputStream aInput) [virtual]

A virtual function to read a projection object from serialized data. Derived classes call this base function then read any data of their own.

Reimplemented from CartoType::TCoordinateTransform.

CT_EXPORT TResult TMercator::Write ( TDataOutputStream aOutput) const [virtual]

A virtual function to write a projection object as serialized data. Derived classes call this base function then write any data of their own. What is written is not the constructed object but the parameter block needed to create it; in this case TCoordinateTransformParam.

Reimplemented from CartoType::TCoordinateTransform.


Member Data Documentation

The prime meridian of longitude.


The documentation for this class was generated from the following files: