OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
#include <ossimGeoTiff.h>
Public Member Functions | |
ossimGeoTiff () | |
default constructor More... | |
ossimGeoTiff (const ossimFilename &file, ossim_uint32 entryIdx=0) | |
~ossimGeoTiff () | |
bool | readTags (const ossimFilename &file, ossim_uint32 entryIdx=0) |
Reads tags. More... | |
bool | readTags (TIFF *tiff, ossim_uint32 entryIdx, bool ownTiffPtrFlag) |
Method to parse the tiff file from an open tiff pointer for a given index. More... | |
bool | readTags (std::shared_ptr< ossim::TiffHandlerState > state, ossim_uint32 entryIdx) |
int | mapZone () const |
Returns the map zone as an interger. More... | |
bool | addImageGeometry (ossimKeywordlist &kwl, const char *prefix=0) const |
Add geometry info from tags to keword list. More... | |
ossimString | getOssimProjectionName () const |
Returns an ossimString representing the ossim projection name. More... | |
void | setOssimProjectionName () |
Attempts to set the ossim projection name from keys read. More... | |
void | setOssimProjectionName (std::shared_ptr< ossim::TiffHandlerState > state, ossim_int32 entryIdx=0) |
Attempts to set the ossim projection name from keys read. More... | |
ossimString | getOssimDatumName () const |
Returns an ossimString representing the ossim datum name code. More... | |
void | setOssimDatumName () |
Attempts to set the ossim datum code. More... | |
void | setOssimDatumName (std::shared_ptr< ossim::TiffHandlerState > state, ossim_int32 entryIdx=0) |
void | getScale (std::vector< double > &scale) const |
void | getTiePoint (std::vector< double > &tie_point) const |
void | getModelTransformation (std::vector< double > &transform) const |
const std::vector< double > & | getTiePoint () const |
const std::vector< double > & | getModelTransformation () const |
const std::vector< double > & | getScale () const |
ossimPixelType | getRasterType () const |
int | getWidth () const |
int | getLength () const |
virtual std::ostream & | print (std::ostream &out) const |
Prints data members. More... | |
![]() | |
ossimErrorStatusInterface () | |
virtual | ~ossimErrorStatusInterface () |
virtual ossimErrorCode | getErrorStatus () const |
virtual ossimString | getErrorStatusString () const |
virtual void | setErrorStatus (ossimErrorCode error_status) const |
virtual void | setErrorStatus () const |
virtual void | clearErrorStatus () const |
bool | hasError () const |
Static Public Member Functions | |
static int | getPcsUnitType (ossim_int32 pcsCode) |
static bool | writeTags (TIFF *tiffOut, const ossimRefPtr< ossimMapProjectionInfo > projectionInfo, bool imagineNad27Flag=false) |
static bool | writeJp2GeotiffBox (const ossimFilename &tmpFile, const ossimIrect &rect, const ossimProjection *proj, std::vector< ossim_uint8 > &buf, ossimPixelType pixelType) |
Writes a geotiff box to a buffer. More... | |
Private Member Functions | |
ossimGeoTiff & | operator= (const ossimGeoTiff &) |
bool | parsePcsCode () |
Initializes data members given a projection code. More... | |
bool | parseProjection (ossimMapProjection *map_proj) |
Initializes data members given a projection. Returns TRUE if successful. More... | |
double | convert2meters (double d) const |
Converts double passed in to meters if needed. More... | |
bool | usingModelTransform () const |
void | getTieSet (ossimTieGptSet &tieSet) const |
Initializes tieSet from theTiePoints. More... | |
bool | hasOneBasedTiePoints () const |
Attempts to detect if tie points are one or zero based. More... | |
Private Attributes | |
TIFF * | theTiffPtr |
ossim_uint32 | theGeoKeyOffset |
int | theGeoKeyLength |
bool | theGeoKeysPresentFlag |
int | theZone |
ossimString | theHemisphere |
int | theDoubleParamLength |
int | theAsciiParamLength |
ossimString | theProjectionName |
ossimString | theDatumName |
std::vector< double > | theScale |
std::vector< double > | theTiePoint |
std::vector< double > | theModelTransformation |
std::vector< double > | theDoubleParam |
ossimString | theAsciiParam |
ossim_uint32 | theWidth |
ossim_uint32 | theLength |
ossim_uint16 | theBitsPerSample |
ossim_uint16 | theModelType |
ossim_uint16 | theRasterType |
ossim_uint16 | theGcsCode |
ossim_uint16 | theDatumCode |
ossim_uint16 | theAngularUnits |
ossim_uint32 | thePcsCode |
ossimString | thePcsCitation |
ossim_uint16 | theCoorTransGeoCode |
ossim_uint16 | theLinearUnitsCode |
double | theStdPar1 |
double | theStdPar2 |
double | theOriginLon |
double | theOriginLat |
double | theFalseEasting |
double | theFalseNorthing |
double | theScaleFactor |
ossimPrivateGtifDef * | thePrivateDefinitions |
Static Private Attributes | |
static std::mutex | theMutex |
Additional Inherited Members | |
![]() | |
ossimErrorCode | theErrorStatus |
Definition at line 35 of file ossimGeoTiff.h.
anonymous enum |
Definition at line 45 of file ossimGeoTiff.h.
Enumerator | |
---|---|
UNKNOWN | |
MODEL_TYPE_PROJECTED | |
MODEL_TYPE_GEOGRAPHIC | |
MODEL_TYPE_GEOCENTRIC |
Definition at line 100 of file ossimGeoTiff.h.
ossimGeoTiff::ossimGeoTiff | ( | ) |
default constructor
Definition at line 90 of file ossimGeoTiff.cpp.
ossimGeoTiff::ossimGeoTiff | ( | const ossimFilename & | file, |
ossim_uint32 | entryIdx = 0 |
||
) |
Definition at line 127 of file ossimGeoTiff.cpp.
ossimGeoTiff::~ossimGeoTiff | ( | ) |
Definition at line 192 of file ossimGeoTiff.cpp.
References thePrivateDefinitions, and theTiffPtr.
bool ossimGeoTiff::addImageGeometry | ( | ossimKeywordlist & | kwl, |
const char * | prefix = 0 |
||
) | const |
Add geometry info from tags to keword list.
Returns true on success, false on error.
Definition at line 1517 of file ossimGeoTiff.cpp.
Referenced by ossimTiffProjectionFactory::createProjection(), and ossimplugins::ossimTerraSarTiffReader::getInternalImageGeometry().
|
private |
Converts double passed in to meters if needed.
The conversion is base on "theLiniarUnitsCode".
Definition at line 1887 of file ossimGeoTiff.cpp.
References ossim::ft2mtrs(), LINEAR_FOOT, LINEAR_FOOT_US_SURVEY, LINEAR_METER, theLinearUnitsCode, and ossim::usft2mtrs().
int ossimGeoTiff::getLength | ( | ) | const |
void ossimGeoTiff::getModelTransformation | ( | std::vector< double > & | transform | ) | const |
Definition at line 2175 of file ossimGeoTiff.cpp.
References theModelTransformation.
const std::vector< double > & ossimGeoTiff::getModelTransformation | ( | ) | const |
Definition at line 2198 of file ossimGeoTiff.cpp.
References theModelTransformation.
Referenced by usingModelTransform().
ossimString ossimGeoTiff::getOssimDatumName | ( | ) | const |
Returns an ossimString representing the ossim datum name code.
Returns "unknown" if it can't find a match.
Definition at line 1992 of file ossimGeoTiff.cpp.
References theDatumName.
ossimString ossimGeoTiff::getOssimProjectionName | ( | ) | const |
Returns an ossimString representing the ossim projection name.
Returns "unknown" if it can't find a match.
Definition at line 1911 of file ossimGeoTiff.cpp.
References theProjectionName.
|
static |
Definition at line 206 of file ossimGeoTiff.cpp.
References ossimMapProjection::getProjectionUnits(), ossimEpsgProjectionDatabase::instance(), LINEAR_FOOT, LINEAR_FOOT_US_SURVEY, LINEAR_METER, OSSIM_FEET, OSSIM_METERS, OSSIM_UNIT_UNKNOWN, OSSIM_US_SURVEY_FEET, PTR_CAST, and UNDEFINED.
Referenced by writeTags().
ossimPixelType ossimGeoTiff::getRasterType | ( | ) | const |
Definition at line 2185 of file ossimGeoTiff.cpp.
References OSSIM_PIXEL_IS_AREA, OSSIM_PIXEL_IS_POINT, PIXEL_IS_AREA, and theRasterType.
void ossimGeoTiff::getScale | ( | std::vector< double > & | scale | ) | const |
const std::vector< double > & ossimGeoTiff::getScale | ( | ) | const |
void ossimGeoTiff::getTiePoint | ( | std::vector< double > & | tie_point | ) | const |
const std::vector< double > & ossimGeoTiff::getTiePoint | ( | ) | const |
|
private |
Initializes tieSet from theTiePoints.
Has logic to shift one based ties to be zero based like the rest of the code.
Definition at line 2298 of file ossimGeoTiff.cpp.
References ossimTieGptSet::addTiePoint(), hasOneBasedTiePoints(), and theTiePoint.
int ossimGeoTiff::getWidth | ( | ) | const |
|
private |
Attempts to detect if tie points are one or zero based.
Definition at line 2320 of file ossimGeoTiff.cpp.
References theLength, theTiePoint, and theWidth.
Referenced by getTieSet().
int ossimGeoTiff::mapZone | ( | ) | const |
Returns the map zone as an interger.
Definition at line 2160 of file ossimGeoTiff.cpp.
References theZone.
|
inlineprivate |
Definition at line 221 of file ossimGeoTiff.h.
|
private |
Initializes data members given a projection code.
Initializes data members given a projection code. Returns TRUE if valid PCS code specified.
Returns TRUE if valid PCS code specified. Resets the PCS code to 0 if invalid.
Definition at line 2076 of file ossimGeoTiff.cpp.
References ossimEpsgProjectionFactory::createProjection(), ossimRefPtr< T >::get(), ossimEpsgProjectionFactory::instance(), parseProjection(), PTR_CAST, thePcsCode, and ossimString::toString().
|
private |
Initializes data members given a projection. Returns TRUE if successful.
Initializes data members given a projection.
Definition at line 2092 of file ossimGeoTiff.cpp.
References ANGULAR_DEGREE, ossimDatum::epsgCode(), ossimMapProjection::getDatum(), ossimMapProjection::getFalseEasting(), ossimMapProjection::getFalseNorthing(), ossimUtmProjection::getHemisphere(), ossimMapProjection::getPcsCode(), ossimMapProjection::getProjectionName(), ossimTransMercatorProjection::getScaleFactor(), ossimMapProjection::getStandardParallel1(), ossimMapProjection::getStandardParallel2(), ossimUtmProjection::getZone(), ossimMapProjection::isGeographic(), ossimDatum::name(), ossimMapProjection::origin(), PTR_CAST, theAngularUnits, theDatumCode, theDatumName, theFalseEasting, theFalseNorthing, theGcsCode, theHemisphere, theLinearUnitsCode, theModelType, theOriginLat, theOriginLon, thePcsCode, theProjectionName, theScaleFactor, theStdPar1, theStdPar2, and theZone.
Referenced by parsePcsCode().
|
virtual |
Prints data members.
Reimplemented from ossimErrorStatusInterface.
Definition at line 2213 of file ossimGeoTiff.cpp.
References theModelTransformation, theScale, and theTiePoint.
bool ossimGeoTiff::readTags | ( | const ossimFilename & | file, |
ossim_uint32 | entryIdx = 0 |
||
) |
Reads tags.
Returns true on success, false on error.
Definition at line 963 of file ossimGeoTiff.cpp.
References ossimString::c_str().
Referenced by ossimTiffProjectionFactory::createProjection(), and ossimplugins::ossimTerraSarTiffReader::getInternalImageGeometry().
bool ossimGeoTiff::readTags | ( | TIFF * | tiff, |
ossim_uint32 | entryIdx, | ||
bool | ownTiffPtrFlag | ||
) |
Method to parse the tiff file from an open tiff pointer for a given index.
This will initialize this container for a subsequent call to addImageGeometry.
tiff | The opened TIFF* to read from. |
entryIdx | Entry (tiff directory) to read. |
ownTiffPtrFlag | If true the tiff pointer will be deleted by this object; else, it will simply zero out the pointer at the end of method. This allows for external code to pass in their open tiff pointer without this object closing it. |
Definition at line 1122 of file ossimGeoTiff.cpp.
References ossimPrivateGtifDef::m_defs, theGeoKeysPresentFlag, theMutex, thePrivateDefinitions, and theTiffPtr.
bool ossimGeoTiff::readTags | ( | std::shared_ptr< ossim::TiffHandlerState > | state, |
ossim_uint32 | entryIdx | ||
) |
Definition at line 976 of file ossimGeoTiff.cpp.
References ANGULAR_DMS_HEMISPHERE, theAngularUnits, theDatumCode, theGcsCode, theGeoKeysPresentFlag, theLength, theLinearUnitsCode, theModelType, theMutex, theScaleFactor, and theWidth.
void ossimGeoTiff::setOssimDatumName | ( | ) |
Attempts to set the ossim datum code.
Definition at line 1997 of file ossimGeoTiff.cpp.
References theDatumName.
void ossimGeoTiff::setOssimDatumName | ( | std::shared_ptr< ossim::TiffHandlerState > | state, |
ossim_int32 | entryIdx = 0 |
||
) |
Definition at line 2031 of file ossimGeoTiff.cpp.
References theDatumName.
void ossimGeoTiff::setOssimProjectionName | ( | ) |
Attempts to set the ossim projection name from keys read.
Definition at line 1916 of file ossimGeoTiff.cpp.
References theProjectionName.
void ossimGeoTiff::setOssimProjectionName | ( | std::shared_ptr< ossim::TiffHandlerState > | state, |
ossim_int32 | entryIdx = 0 |
||
) |
Attempts to set the ossim projection name from keys read.
Definition at line 1952 of file ossimGeoTiff.cpp.
References theProjectionName.
|
private |
Definition at line 2277 of file ossimGeoTiff.cpp.
References getModelTransformation(), size, theScale, and theTiePoint.
|
static |
Writes a geotiff box to a buffer.
This will write a degenerate GeoTIFF file to a temp file, copy file to the buffer and then delete the temp file.
tmpFile | The temporary filename. |
rect | The output image rect. |
proj | Pointer to output projection. |
buf | The buffer to stuff with data. |
pixelType | OSSIM_PIXEL_IS_POINT(0) or OSSIM_PIXEL_IS_AREA(1) |
Definition at line 847 of file ossimGeoTiff.cpp.
References ossimString::c_str(), ossimFilename::fileSize(), PTR_CAST, ossimFilename::remove(), ossimMapProjectionInfo::setPixelType(), and writeTags().
Referenced by ossimOpjCompressor::writeGeotiffBox(), and ossimKakaduCompressor::writeGeotiffBox().
|
static |
Definition at line 238 of file ossimGeoTiff.cpp.
References ANGULAR_DEGREE, ossimDatum::code(), ossimDatum::ellipsoid(), ossimDatum::epsgCode(), ossimKeywordlist::find(), ossimObject::getClassName(), ossimMapProjection::getDatum(), ossimEllipsoid::getEpsgCode(), ossimMapProjection::getFalseEasting(), ossimMapProjection::getFalseNorthing(), getMetersEquivalentHarnCode(), ossimMapProjection::getPcsCode(), getPcsUnitType(), ossimMapProjectionInfo::getProjection(), ossimMapProjection::isGeographic(), LINEAR_FOOT, LINEAR_FOOT_US_SURVEY, LINEAR_METER, ossimDatum::name(), ossimMapProjection::origin(), ossimMapProjection::saveState(), ossimKeywordNames::SCALE_FACTOR_KW, ossimKeywordNames::STD_PARALLEL_1_KW, ossimKeywordNames::STD_PARALLEL_2_KW, theMutex, UNDEFINED, and USER_DEFINED.
Referenced by ossimTiffWriter::writeGeotiffTags(), and writeJp2GeotiffBox().
|
private |
Definition at line 279 of file ossimGeoTiff.h.
Referenced by parseProjection(), and readTags().
|
private |
Definition at line 269 of file ossimGeoTiff.h.
|
private |
Definition at line 261 of file ossimGeoTiff.h.
|
private |
Definition at line 273 of file ossimGeoTiff.h.
|
private |
Definition at line 282 of file ossimGeoTiff.h.
|
private |
Definition at line 278 of file ossimGeoTiff.h.
Referenced by parseProjection(), and readTags().
|
private |
Definition at line 263 of file ossimGeoTiff.h.
Referenced by getOssimDatumName(), parseProjection(), and setOssimDatumName().
|
private |
Definition at line 268 of file ossimGeoTiff.h.
|
private |
Definition at line 260 of file ossimGeoTiff.h.
|
private |
Definition at line 288 of file ossimGeoTiff.h.
Referenced by parseProjection().
|
private |
Definition at line 289 of file ossimGeoTiff.h.
Referenced by parseProjection().
|
private |
Definition at line 277 of file ossimGeoTiff.h.
Referenced by parseProjection(), and readTags().
|
private |
Definition at line 256 of file ossimGeoTiff.h.
|
private |
Definition at line 255 of file ossimGeoTiff.h.
|
private |
Definition at line 257 of file ossimGeoTiff.h.
Referenced by readTags().
|
private |
Definition at line 259 of file ossimGeoTiff.h.
Referenced by parseProjection().
|
private |
Definition at line 272 of file ossimGeoTiff.h.
Referenced by getLength(), hasOneBasedTiePoints(), and readTags().
|
private |
Definition at line 283 of file ossimGeoTiff.h.
Referenced by convert2meters(), parseProjection(), and readTags().
|
private |
Definition at line 267 of file ossimGeoTiff.h.
Referenced by getModelTransformation(), and print().
|
private |
Definition at line 275 of file ossimGeoTiff.h.
Referenced by parseProjection(), and readTags().
|
staticprivate |
Definition at line 294 of file ossimGeoTiff.h.
Referenced by readTags(), and writeTags().
|
mutableprivate |
Definition at line 287 of file ossimGeoTiff.h.
Referenced by parseProjection().
|
mutableprivate |
Definition at line 286 of file ossimGeoTiff.h.
Referenced by parseProjection().
|
private |
Definition at line 281 of file ossimGeoTiff.h.
|
private |
Definition at line 280 of file ossimGeoTiff.h.
Referenced by parsePcsCode(), and parseProjection().
|
private |
Definition at line 292 of file ossimGeoTiff.h.
Referenced by readTags(), and ~ossimGeoTiff().
|
private |
Definition at line 262 of file ossimGeoTiff.h.
Referenced by getOssimProjectionName(), parseProjection(), and setOssimProjectionName().
|
private |
Definition at line 276 of file ossimGeoTiff.h.
Referenced by getRasterType().
|
private |
Definition at line 265 of file ossimGeoTiff.h.
Referenced by getScale(), print(), and usingModelTransform().
|
private |
Definition at line 290 of file ossimGeoTiff.h.
Referenced by parseProjection(), and readTags().
|
private |
Definition at line 284 of file ossimGeoTiff.h.
Referenced by parseProjection().
|
private |
Definition at line 285 of file ossimGeoTiff.h.
Referenced by parseProjection().
|
private |
Definition at line 266 of file ossimGeoTiff.h.
Referenced by getTiePoint(), getTieSet(), hasOneBasedTiePoints(), print(), and usingModelTransform().
|
private |
Definition at line 254 of file ossimGeoTiff.h.
Referenced by readTags(), and ~ossimGeoTiff().
|
private |
Definition at line 271 of file ossimGeoTiff.h.
Referenced by getWidth(), hasOneBasedTiePoints(), and readTags().
|
private |
Definition at line 258 of file ossimGeoTiff.h.
Referenced by mapZone(), and parseProjection().