MrSID Decode SDK for Raster Reference Manual  9.1.0.4045
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...
 
LTIGeoCoordoperator= (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...
 
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...
 

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
xULupper-left x position
yULupper-left y position
xResx resolution
yResy resolution
xRotx rotation
yRoty rotation
wktWell 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
geoXx geo position
geoYy geo position
magmagnification level (pixelX, pixelY) will be in
pixelXx pixel position
pixelYy 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
xULupper-left x position
yULupper-left y position
xResx resolution
yResy resolution
xRotx rotation
yRoty 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
scenescene
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
fileSpecthe name of the image file
extan 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::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
pixelXx pixel position
pixelYy pixel position
magmagnification level (pixelX, pixelY) are in
geoXx geo position
geoYy 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
metadatathe metadata database to read from
foundwill 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
fileSpecthe name of the world file to read from
determineExtensionif true, replace extension in fileSpec; otherwise, just use fileSpec
fileFoundwill 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
streamthe world file data read from
Returns
status code indicating success or failure
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
xULupper-left x position
yULupper-left y position
xResx resolution
yResy resolution
xRotx rotation
yRoty rotation
void LTIGeoCoord::setWKT ( const char *  wkt)

Sets the WKT

Parameters
wktthe WKT
void LTIGeoCoord::setX ( double  x)

Sets the upper-left X position.

Parameters
xthe upper-left X position
void LTIGeoCoord::setXRes ( double  xRes)

Sets the X resolution

Parameters
xResthe X resolution
void LTIGeoCoord::setXRot ( double  xRot)

Sets the X rotation

Parameters
xRotthe X rotation
void LTIGeoCoord::setY ( double  y)

Sets the upper-left Y position.

Parameters
ythe upper-left Y position
void LTIGeoCoord::setYRes ( double  yRes)

Sets the Y resolution

Parameters
yResthe Y resolution
void LTIGeoCoord::setYRot ( double  yRot)

Sets the Y rotation

Parameters
yRotthe Y rotation
LT_STATUS LTIGeoCoord::writeMetadata ( LTIMetadataDatabase metadata) const

This function writes the geographic data out to the metadata.

Parameters
metadatathe 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
fileSpecthe name of the world file to write to
determineExtensionif 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:

LizardTech