MrSID Decode SDK for Raster Reference Manual
9.5.4.4709
|
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... | |
The LTIGeoCoord class contains geographic coordinate information: x and y resolution, upper left point, and x and y rotation.
Definition at line 32 of file lti_geoCoord.h.
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.
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 | ( | ) |
LT_STATUS LTIGeoCoord::geoToPixel | ( | double | geoX, |
double | geoY, | ||
double | mag, | ||
double & | pixelX, | ||
double & | pixelY | ||
) | const |
geoX | x geo position |
geoY | y geo position |
mag | magnification level (pixelX, pixelY) will be in |
pixelX | x pixel position |
pixelY | y pixel position |
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.
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.
scene | scene |
const char* LTIGeoCoord::getWKT | ( | ) | const |
Returns the WKT
|
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.
fileSpec | the name of the image file |
ext | an array of (at least) 4 bytes |
double LTIGeoCoord::getX | ( | ) | const |
Returns the upper-left X position.
double LTIGeoCoord::getXRes | ( | ) | const |
double LTIGeoCoord::getXRot | ( | ) | const |
Returns the X rotation
double LTIGeoCoord::getY | ( | ) | const |
Returns the upper-left Y position.
double LTIGeoCoord::getYRes | ( | ) | const |
double LTIGeoCoord::getYRot | ( | ) | const |
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 |
pixelX | x pixel position |
pixelY | y pixel position |
mag | magnification level (pixelX, pixelY) are in |
geoX | x geo position |
geoY | y geo position |
LT_STATUS LTIGeoCoord::readMetadata | ( | const LTIMetadataDatabase & | metadata, |
bool & | found | ||
) |
This function reads the geographic data in from the given metadata database.
metadata | the metadata database to read from |
found | will be if true, if metadata has geographic data |
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.
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 |
LT_STATUS LTIGeoCoord::readWorldFile | ( | LTIOStreamInf & | stream | ) |
This function reads the geographic data in from the given "world file", using an LTIOStreamInf interface.
stream | the world file data read from |
LTIGeoCoord LTIGeoCoord::scaleGeoCoord | ( | double | xMag, |
double | yMag | ||
) | const |
Return a LTIGeoCoord object for the center of the upper-left pixel of the given scene.
xMag | |
yMag |
void LTIGeoCoord::set | ( | double | xUL, |
double | yUL, | ||
double | xRes, | ||
double | yRes, | ||
double | xRot, | ||
double | yRot | ||
) |
void LTIGeoCoord::setWKT | ( | const char * | wkt | ) |
Sets the WKT
wkt | the WKT |
void LTIGeoCoord::setX | ( | double | x | ) |
Sets the upper-left X position.
x | the upper-left X position |
void LTIGeoCoord::setXRes | ( | double | xRes | ) |
Sets the X resolution
xRes | the X resolution |
void LTIGeoCoord::setXRot | ( | double | xRot | ) |
Sets the X rotation
xRot | the X rotation |
void LTIGeoCoord::setY | ( | double | y | ) |
Sets the upper-left Y position.
y | the upper-left Y position |
void LTIGeoCoord::setYRes | ( | double | yRes | ) |
Sets the Y resolution
yRes | the Y resolution |
void LTIGeoCoord::setYRot | ( | double | yRot | ) |
Sets the Y rotation
yRot | the Y rotation |
LT_STATUS LTIGeoCoord::writeMetadata | ( | LTIMetadataDatabase & | metadata | ) | const |
This function writes the geographic data out to the metadata.
metadata | the metadata database to write to |
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.
fileSpec | the name of the world file to write to |
determineExtension | if true, replace extension in fileSpec; otherwise, just use fileSpec |
LizardTech |