MrSID Decode SDK for Raster Reference Manual 9.5.4.4709

- Main Page
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | List of all members
LTIGeoCoord Class Reference

represents a geographic coordinate More...

`#include <lti_geoCoord.h>`

## Public Member Functions
| LTIGeoCoord (double xUL, double yUL, double xRes, double yRes, double xRot, double yRot, const char *wkt=NULL)
| constructor More...
| LTIGeoCoord ()
| default constructor More...
| LTIGeoCoord (const LTIGeoCoord &)
| copy constructor More...
| ~LTIGeoCoord ()
| destructor More...
LTIGeoCoord & | operator= (const LTIGeoCoord &)
| assignment operator More...
bool | operator== (const LTIGeoCoord &) const
| equality operator More...
bool | operator!= (const LTIGeoCoord &) const
| inequality operator More...
double | getX () const
| get the upper-left X position More...
double | getY () const
| get the upper-left Y position More...
double | getXRes () const
| get the X resolution More...
double | getYRes () const
| get the Y resolution More...
double | getXRot () const
| get the X rotation More...
double | getYRot () const
| get the Y rotation More...
const char * | getWKT () const
| get the Well Known Text (WKT) More...
void | get (double &xUL, double &yUL, double &xRes, double &yRes, double &xRot, double &yRot) const
| get the coordinate information More...
LT_STATUS | pixelToGeo (double pixelX, double pixelY, double mag, double &geoX, double &geoY) const
| convert a pixel coordinate to geo coordinate More...
LT_STATUS | geoToPixel (double geoX, double geoY, double mag, double &pixelX, double &pixelY) const
| convert a geo coordinate to pixel coordinate More...
LTIGeoCoord | getGeoCoordForScene (const LTIScene &scene) const
| get the coordinate information for a given scene More...
LTIGeoCoord | scaleGeoCoord (double xMag, double yMag) const
| get the coordinate information for a given offset and scale More...
void | setX (double x)
| set the upper-left X position More...
void | setY (double y)
| set the upper-left Y position More...
void | setXRes (double xRes)
| set the X resolution More...
void | setYRes (double yRes)
| set the Y resolution More...
void | setXRot (double xRot)
| set the X rotation More...
void | setYRot (double yRot)
| set the Y rotation More...
void | set (double xUL, double yUL, double xRes, double yRes, double xRot, double yRot)
| set the coordinate information More...
void | setWKT (const char *wkt)
| set the WKT More...
LT_STATUS | writeWorldFile (const LTFileSpec &fileSpec, bool determineExtension) const
| write data to world file More...
LT_STATUS | readWorldFile (const LTFileSpec &fileSpec, bool determineExtension, bool &fileFound)
| read data from world file More...
LT_STATUS | readWorldFile (LTIOStreamInf &stream)
| read data from world file, via a stream More...
LT_STATUS | writeMetadata (LTIMetadataDatabase &metadata) const
| write data to metadata More...
LT_STATUS | readMetadata (const LTIMetadataDatabase &metadata, bool &found)
| read data from metadata More...
bool | hasRotation (void) const

## Static Public Member Functions
static LT_STATUS | getWorldFileExtension (const LTFileSpec &fileSpec, char *ext)
| get file extension text More...

## Detailed Description

The LTIGeoCoord class contains geographic coordinate information: x and y resolution, upper left point, and x and y rotation.

Note
  As per the conventions for georeferenced images, the Y resolution is typically a negative value.

Examples:
  GeoScene.cpp, and ImageInfo.cpp.

Definition at line 32 of file lti_geoCoord.h.

## Constructor & Destructor Documentation

LTIGeoCoord::LTIGeoCoord | ( | double | xUL,
|  | double | yUL,
|  | double | xRes,
|  | double | yRes,
|  | double | xRot,
|  | double | yRot,
|  | const char * | wkt = `NULL`
| ) |  |

Creates an LTIGeoCoord object with the given coordinate information.

Parameters

  xUL | upper-left x position
  yUL | upper-left y position
  xRes | x resolution
  yRes | y resolution
  xRot | x rotation
  yRot | y rotation
  wkt | Well Known Text string

LTIGeoCoord::LTIGeoCoord | ( | ) |  |

LTIGeoCoord::LTIGeoCoord | ( | const LTIGeoCoord & | ) |  |

LTIGeoCoord::~LTIGeoCoord | ( | ) |  |

## Member Function Documentation

LT_STATUS LTIGeoCoord::geoToPixel | ( | double | geoX,
|  | double | geoY,
|  | double | mag,
|  | double & | pixelX,
|  | double & | pixelY
| ) |  | const

Parameters

  geoX | x geo position
  geoY | y geo position
  mag | magnification level (pixelX, pixelY) will be in
  pixelX | x pixel position
  pixelY | y pixel position

Returns
  status code indicating success or failure

void LTIGeoCoord::get | ( | double & | xUL,
|  | double & | yUL,
|  | double & | xRes,
|  | double & | yRes,
|  | double & | xRot,
|  | double & | yRot
| ) |  | const

Returns all the coordinate information. This is equivalent to calling getXUL(), getXRes(), etc.

Parameters

  xUL | upper-left x position
  yUL | upper-left y position
  xRes | x resolution
  yRes | y resolution
  xRot | x rotation
  yRot | y rotation

LTIGeoCoord LTIGeoCoord::getGeoCoordForScene | ( | const LTIScene & | scene) |  | const

Return a LTIGeoCoord object for the center of the upper-left pixel of the given scene.

Parameters

  scene | scene

Returns
  a LTIGeoCoord object for scene

const char* LTIGeoCoord::getWKT | ( | ) |  | const

Returns the WKT

Returns
  the WKT

static LT_STATUS LTIGeoCoord::getWorldFileExtension | ( | const LTFileSpec & | fileSpec,
|  | char * | ext
| ) |  |
| static

This function computes the "official" world file extension for the given image file name. Typically this is formed by concatenating the first and last letters of the image file extension and a 'w', e.g. "foo.jpg" returns "jgw".

If the first and last characters of the extension are both uppercase, then the 'W' is uppercase, e.g. "foo.JPG" return "JPW".

The `ext` parameter must be allocated to be at least 4 bytes prior to the call.

Parameters

  fileSpec | the name of the image file
  ext | an array of (at least) 4 bytes

Returns
  status code indicating success or failure

double LTIGeoCoord::getX | ( | ) |  | const

Returns the upper-left X position.

Returns
  the upper-left X position

Examples:
  GeoScene.cpp, and ImageInfo.cpp.

double LTIGeoCoord::getXRes | ( | ) |  | const

Returns the X resolution

Returns
  the X resolution

Examples:
  GeoScene.cpp, and ImageInfo.cpp.

double LTIGeoCoord::getXRot | ( | ) |  | const

Returns the X rotation

Returns
  the X rotation

double LTIGeoCoord::getY | ( | ) |  | const

Returns the upper-left Y position.

Returns
  the upper-left Y position

Examples:
  GeoScene.cpp, and ImageInfo.cpp.

double LTIGeoCoord::getYRes | ( | ) |  | const

Returns the Y resolution

Returns
  the Y resolution

Examples:
  GeoScene.cpp, and ImageInfo.cpp.

double LTIGeoCoord::getYRot | ( | ) |  | const

Returns the Y rotation

Returns
  the Y rotation

bool LTIGeoCoord::hasRotation | ( | void | ) |  | const

bool LTIGeoCoord::operator!= | ( | const LTIGeoCoord & | ) |  | const

LTIGeoCoord& LTIGeoCoord::operator= | ( | const LTIGeoCoord & | ) |  |

bool LTIGeoCoord::operator== | ( | const LTIGeoCoord & | ) |  | const

LT_STATUS LTIGeoCoord::pixelToGeo | ( | double | pixelX,
|  | double | pixelY,
|  | double | mag,
|  | double & | geoX,
|  | double & | geoY
| ) |  | const

Parameters

  pixelX | x pixel position
  pixelY | y pixel position
  mag | magnification level (pixelX, pixelY) are in
  geoX | x geo position
  geoY | y geo position

Returns
  status code indicating success or failure

LT_STATUS LTIGeoCoord::readMetadata | ( | const LTIMetadataDatabase & | metadata,
|  | bool & | found
| ) |  |

This function reads the geographic data in from the given metadata database.

Parameters

  metadata | the metadata database to read from
  found | will be if true, if metadata has geographic data

Returns
  status code indicating success or failure

LT_STATUS LTIGeoCoord::readWorldFile | ( | const LTFileSpec & | fileSpec,
|  | bool | determineExtension,
|  | bool & | fileFound
| ) |  |

This function reads the geographic data in from the given "world file", if file present. If no world file found, fileFound set to false and returns LT_STS_Success.

Parameters

  fileSpec | the name of the world file to read from
  determineExtension | if true, replace extension in fileSpec; otherwise, just use fileSpec
  fileFound | will be if true, if world file was found and read

Returns
  status code indicating success or failure

LT_STATUS LTIGeoCoord::readWorldFile | ( | LTIOStreamInf & | stream) |  |

This function reads the geographic data in from the given "world file", using an LTIOStreamInf interface.

Parameters

  stream | the world file data read from

Returns
  status code indicating success or failure

LTIGeoCoord LTIGeoCoord::scaleGeoCoord | ( | double | xMag,
|  | double | yMag
| ) |  | const

Return a LTIGeoCoord object for the center of the upper-left pixel of the given scene.

Parameters

  xMag |
  yMag |

Returns
  a LTIGeoCoord object

void LTIGeoCoord::set | ( | double | xUL,
|  | double | yUL,
|  | double | xRes,
|  | double | yRes,
|  | double | xRot,
|  | double | yRot
| ) |  |

Sets the coordinate information. This is equivalent to calling setX(), setXRes(), etc.

Parameters

  xUL | upper-left x position
  yUL | upper-left y position
  xRes | x resolution
  yRes | y resolution
  xRot | x rotation
  yRot | y rotation

void LTIGeoCoord::setWKT | ( | const char * | wkt) |  |

Sets the WKT

Parameters

  wkt | the WKT

void LTIGeoCoord::setX | ( | double | x) |  |

Sets the upper-left X position.

Parameters

  x | the upper-left X position

void LTIGeoCoord::setXRes | ( | double | xRes) |  |

Sets the X resolution

Parameters

  xRes | the X resolution

void LTIGeoCoord::setXRot | ( | double | xRot) |  |

Sets the X rotation

Parameters

  xRot | the X rotation

void LTIGeoCoord::setY | ( | double | y) |  |

Sets the upper-left Y position.

Parameters

  y | the upper-left Y position

void LTIGeoCoord::setYRes | ( | double | yRes) |  |

Sets the Y resolution

Parameters

  yRes | the Y resolution

void LTIGeoCoord::setYRot | ( | double | yRot) |  |

Sets the Y rotation

Parameters

  yRot | the Y rotation

LT_STATUS LTIGeoCoord::writeMetadata | ( | LTIMetadataDatabase & | metadata) |  | const

This function writes the geographic data out to the metadata.

Parameters

  metadata | the metadata database to write to

Returns
  status code indicating success or failure

LT_STATUS LTIGeoCoord::writeWorldFile | ( | const LTFileSpec & | fileSpec,
|  | bool | determineExtension
| ) |  | const

This function writes the geographic data out in "world file" format to the specified file. If extension is not NULL, the extension will be used to replace the extension in the filename.

Parameters

  fileSpec | the name of the world file to write to
  determineExtension | if true, replace extension in fileSpec; otherwise, just use fileSpec

Returns
  status code indicating success or failure

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

- lti_geoCoord.h

LizardTech