vtdata library
Classes | Macros | Typedefs | Functions | Variables
Projections.h File Reference

Classes

class  vtCRS
 

Macros

#define EARTH_RADIUS   6378000.0f
 
#define METERS_PER_LATITUDE   111317.1f
 
#define OCTransform   OGRCoordinateTransformation
 
#define EPSG_DATUM_OLD_HAWAIIAN   6135
 
#define EPSG_DATUM_PUERTO_RICO   6139
 
#define EPSG_DATUM_NAD27   6267
 
#define EPSG_DATUM_NAD83   6269
 
#define EPSG_DATUM_WGS72   6322
 
#define EPSG_DATUM_WGS84   6326
 

Typedefs

typedef scoped_ptr< OGRCoordinateTransformation > ScopedOCTransform
 

Functions

const char * DatumToString (int d)
 
const char * DatumToStringShort (int d)
 
void SetupEPSGDatums ()
 
StatePlaneInfo * GetStatePlaneTable ()
 
int NumStatePlanes ()
 
void CreateSimilarGeographicCRS (const vtCRS &source, vtCRS &geo)
 
OCTransform * CreateTransformIgnoringDatum (const vtCRS *pSource, vtCRS *pTarget)
 
OCTransform * CreateCoordTransform (const vtCRS *pSource, const vtCRS *pTarget, bool bLog=false)
 
void TransformInPlace (OCTransform *transform, DPolygon2 &poly)
 
void TransformInPlace (OCTransform *transform, DLine2 &line)
 
double EstimateDegreesToMeters (double latitude)
 
double GetMetersPerUnit (LinearUnits lu)
 
const char * GetLinearUnitName (LinearUnits lu)
 
double MetersPerLongitude (double latitude)
 
bool ReadAssociatedWorldFile (const char *filename_base, double params[6])
 

Variables

std::vector< EPSGDatum > g_EPSGDatums
 

Function Documentation

OCTransform* CreateCoordTransform ( const vtCRS pSource,
const vtCRS pTarget,
bool  bLog 
)

Use this function instead of OGRCreateCoordinateTransformation to create a transformation between two vtCRSs. Not only does it get around the 'const' issue with the arguments to the OGR function, but it also has a handy logging option, and can deal with any additional projections that vtCRS adds to OGRSpatialReference.

void CreateSimilarGeographicCRS ( const vtCRS source,
vtCRS geo 
)

Given a non-geographic projection, produce a geographic projection which has the same datum/ellipsoid values.

OCTransform* CreateTransformIgnoringDatum ( const vtCRS pSource,
vtCRS pTarget 
)

Create a conversion between projections, making the assumption that the Datum of the target is the same as the Datum of the source.

const char* DatumToString ( int  d)

Convert an a Datum Code to a string of the Datum Name.

const char* DatumToStringShort ( int  d)

Convert a Datum Code to a (short) string of the Datum Name.

double EstimateDegreesToMeters ( double  latitude)

Determine an approximate conversion from degrees of longitude to meters, given a latitude in degrees.

const char* GetLinearUnitName ( LinearUnits  lu)

Return a string describing the units.

double GetMetersPerUnit ( LinearUnits  lu)

Return the number of meters for a given type of linear units

StatePlaneInfo* GetStatePlaneTable ( )

Provides access to the State Plane Table

double MetersPerLongitude ( double  latitude)

Return number of meters per degree of longitude, at a given latitude.

bool ReadAssociatedWorldFile ( const char *  filename_base,
double  params[6] 
)

Read the contents of a world file. You can pass any filename, and it will look for the corresponding world file.

void SetupEPSGDatums ( )

Setup the global array of EPSG Datums, accessible as g_EPSGDatums.