Public Member Functions | |
| vtProjection & | operator= (const vtProjection &ref) |
| bool | operator== (const vtProjection &ref) const |
| bool | operator!= (const vtProjection &ref) const |
| void | SetUTMZone (int iZone) |
| int | GetUTMZone () const |
| OGRErr | SetDatum (int iDatum) |
| int | GetDatum () const |
| LinearUnits | GetUnits () const |
| int | GuessEPSGCode () const |
| OGRErr | SetGeogCSFromDatum (int iDatum) |
| bool | SetProjectionSimple (bool bUTM, int iUTMZone, int iDatum) |
| void | SetSpatialReference (OGRSpatialReference *pRef) |
| const char * | GetProjectionName () const |
| const char * | GetProjectionNameShort () const |
| bool | GetTextDescription (char *type, char *value) const |
| bool | SetTextDescription (const char *type, const char *value) |
| bool | ReadProjFile (const char *filename) |
| bool | WriteProjFile (const char *filename) const |
| void | SetDymaxion (bool bTrue) |
| bool | IsDymaxion () const |
Static Public Member Functions | |
| static double | GeodesicDistance (const DPoint2 &in, const DPoint2 &out, bool bQuick=false) |
Protected Member Functions | |
| void | LogDescription () const |
Protected Attributes | |
| bool | m_bDymaxion |
| double vtProjection::GeodesicDistance | ( | const DPoint2 & | geo1, | |
| const DPoint2 & | geo2, | |||
| bool | bQuick = false | |||
| ) | [static] |
Given two geographic coordinates (longitude/latitude in degrees), return the geodesic arc distance in meters. The WGS84 spheroid is used.
| int vtProjection::GetDatum | ( | ) | const |
Return the datum as an EPSG code (an integer in the range of 6120 - 6904), or -1 if the datum could not be determined.
| const char * vtProjection::GetProjectionName | ( | ) | const |
Return a string describing the type of projection.
| const char * vtProjection::GetProjectionNameShort | ( | ) | const |
Return a very short string describing the type of projection.
| bool vtProjection::GetTextDescription | ( | char * | type, | |
| char * | value | |||
| ) | const |
Get the projection as a text description. If the projection is Geographic or UTM, then a "simple" type string will be returned. For all other projection types, a WKT string is returned.
| type | A string buffer to contain the type of description. This buffer should be at least 7 characters long to contain either the word "simple" or "wkt". | |
| value | A string buffer to contain the full description. This buffer should be at least 2048 characters long to contain either a simple or WKT description. |
| LinearUnits vtProjection::GetUnits | ( | ) | const |
Return the kind of horizontal units used by the projection. This is also called "linear units."
| int vtProjection::GetUTMZone | ( | ) | const |
Get the UTM zone of the projection.
| int vtProjection::GuessEPSGCode | ( | ) | const |
Try to determine the EPSG code that corresponds to the current projection. This important capability is mysteriously absent from the underlying libraries (OGR, PROJ.4) so it is implemented here.
| bool vtProjection::operator!= | ( | const vtProjection & | ref | ) | const |
Inequality operator.
| vtProjection & vtProjection::operator= | ( | const vtProjection & | ref | ) |
Assignment operator.
| bool vtProjection::operator== | ( | const vtProjection & | ref | ) | const |
Equality operator.
| bool vtProjection::ReadProjFile | ( | const char * | filename | ) |
Read the projection from a .prj file.
If the filename does not have the file extension ".prj", this method will look for a file which has the same name with a ".prj" extension.
| OGRErr vtProjection::SetDatum | ( | int | iDatum | ) |
Set the datum to an EPSG Datum code, a value in the range (6120 - 6904).
Here are the codes for some of the better-known datums:
| OGRErr vtProjection::SetGeogCSFromDatum | ( | int | iDatum | ) |
Set the projection to a fresh, new geographical coordinate system based on the indicated Datum.
| bool vtProjection::SetProjectionSimple | ( | bool | bUTM, | |
| int | iUTMZone, | |||
| int | iDatum | |||
| ) |
Convenient way to set a simple projection.
| bUTM | true for UTM, false for Geographic. | |
| iUTMZone | If UTM, this is the zone: 1 through 60 in the northern hemisphere, -1 through -60 for the southern hemisphere. | |
| iDatum | The Datum as either an old USGS code or an EPSG code |
| void vtProjection::SetSpatialReference | ( | OGRSpatialReference * | pRef | ) |
Set the projection by copying from a OGRSpatialReference.
| bool vtProjection::SetTextDescription | ( | const char * | type, | |
| const char * | value | |||
| ) |
Set the projection using a text description.
| type | The type of description, either "simple" for short simple string, or "wkt" for a full-length WKT (Well-Known Text) description. | |
| value | The description itself. A WKT description should be a single string, with no extra whitespace. A simple string can have the following forms:
|
proj.SetTextDescription("simple", "utm, datum WGS_84, zone 11");
| void vtProjection::SetUTMZone | ( | int | iZone | ) |
Get the UTM zone of the projection.
| iZone | Should be one of the following values:
|
| bool vtProjection::WriteProjFile | ( | const char * | filename | ) | const |
Write the projection to a .prj file.
1.5.7.1