MrSID Decode SDK for Raster Reference Manual  9.5.4.4709
LTIGeoCoord Class Reference

represents a geographic coordinate More...

#include <lti_geoCoord.h>

List of all members.

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
LTIGeoCoordoperator= (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
LTIGeoCoord scaleGeoCoord (double xMag, double yMag) const
 get the coordinate information for a given offset and scale
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

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

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

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::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:
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

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
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:
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

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: