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 | |
LTIGeoCoord () | |
default constructor | |
LTIGeoCoord (const LTIGeoCoord &) | |
copy constructor | |
~LTIGeoCoord () | |
destructor | |
LTIGeoCoord & | operator= (const LTIGeoCoord &) |
assignment operator | |
bool | operator== (const LTIGeoCoord &) const |
equality operator | |
bool | operator!= (const LTIGeoCoord &) const |
inequality operator | |
double | getX () const |
get the upper-left X position | |
double | getY () const |
get the upper-left Y position | |
double | getXRes () const |
get the X resolution | |
double | getYRes () const |
get the Y resolution | |
double | getXRot () const |
get the X rotation | |
double | getYRot () const |
get the Y rotation | |
const char * | getWKT () const |
get the Well Known Text (WKT) | |
void | get (double &xUL, double &yUL, double &xRes, double &yRes, double &xRot, double &yRot) const |
get the coordinate information | |
LT_STATUS | pixelToGeo (double pixelX, double pixelY, double mag, double &geoX, double &geoY) const |
convert a pixel coordinate to geo coordinate | |
LT_STATUS | geoToPixel (double geoX, double geoY, double mag, double &pixelX, double &pixelY) const |
convert a geo coordinate to pixel coordinate | |
LTIGeoCoord | getGeoCoordForScene (const LTIScene &scene) const |
get the coordinate information for a given scene | |
void | setX (double x) |
set the upper-left X position | |
void | setY (double y) |
set the upper-left Y position | |
void | setXRes (double xRes) |
set the X resolution | |
void | setYRes (double yRes) |
set the Y resolution | |
void | setXRot (double xRot) |
set the X rotation | |
void | setYRot (double yRot) |
set the Y rotation | |
void | set (double xUL, double yUL, double xRes, double yRes, double xRot, double yRot) |
set the coordinate information | |
void | setWKT (const char *wkt) |
set the WKT | |
LT_STATUS | writeWorldFile (const LTFileSpec &fileSpec, bool determineExtension) const |
write data to world file | |
LT_STATUS | readWorldFile (const LTFileSpec &fileSpec, bool determineExtension, bool &fileFound) |
read data from world file | |
LT_STATUS | readWorldFile (LTIOStreamInf &stream) |
read data from world file, via a stream | |
LT_STATUS | writeMetadata (LTIMetadataDatabase &metadata) const |
write data to metadata | |
LT_STATUS | readMetadata (const LTIMetadataDatabase &metadata, bool &found) |
read data from metadata | |
bool | hasRotation (void) const |
Static Public Member Functions | |
static LT_STATUS | getWorldFileExtension (const LTFileSpec &fileSpec, char *ext) |
get file extension text |
The LTIGeoCoord class contains geographic coordinate information: x and y resolution, upper left point, and x and y rotation.
GeoScene.cpp, and ImageInfo.cpp.
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 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.
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 | ( | 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 |
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 |
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 |