OSSIM - Open Source Software Image Map
Version 1.9.0 (20180803)
|
Projection Database for coded projections defined in database files and specified via some coordinate reference system group:code, such as EPSG:26715. More...
#include <ossimEpsgProjectionDatabase.h>
Classes | |
class | ProjDbRecord |
Type for database record consists of EPSG code and serialized form of corresponding OSSIM projection (as a keywordlist) More... | |
Public Member Functions | |
virtual | ~ossimEpsgProjectionDatabase () |
Destructor. More... | |
ossimProjection * | findProjection (const ossimString &proj_spec) const |
Returns a projection corresponding to the projection specified, or NULL if no entry found. More... | |
ossimProjection * | findProjection (ossim_uint32 epsg_code) const |
Returns a projection corresponding to the epsg code specified, or NULL if no entry found. More... | |
ossim_uint32 | findProjectionCode (const ossimString &projection_name) const |
Given a projection name, assigns the group (e.g., "EPSG") and code of the projection. More... | |
ossim_uint32 | findProjectionCode (const ossimMapProjection &lost_proj) const |
Given a projection instance, this method determines the corresponding EPSG code. More... | |
ossimString | findProjectionName (ossim_uint32 epsg_code) const |
NECESSARY HACK ### (originally implemented by ESH)ArcMap (9.2 and less) doesn't understand the non-meters HARN codes. More... | |
void | getProjectionsList (std::vector< ossimString > &typeList) const |
Populates caller's list with all projections currently represented in the database. More... | |
size_t | numRecords () const |
ENGINEERING CODE. Used for testing. More... | |
ossim_uint32 | getCodeFromUtmProj (const ossimUtmProjection *proj) const |
Given UTM projection, derives the associated EPSG code. This is faster than a Db lookup. More... | |
![]() | |
ossimReferenced () | |
ossimReferenced (const ossimReferenced &) | |
ossimReferenced & | operator= (const ossimReferenced &) |
void | ref () const |
increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
void | unref () const |
decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
void | unref_nodelete () const |
decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
int | referenceCount () const |
Static Public Member Functions | |
static ossimEpsgProjectionDatabase * | instance () |
Instantiates singleton instance of this class: More... | |
Protected Types | |
enum | RecordFormat { NOT_ASSIGNED =0, FORMAT_A, FORMAT_B, FORMAT_C, CUSTOM } |
Protected Member Functions | |
ossimEpsgProjectionDatabase () | |
Constructor loads all Db files specified in the ossim prefs. More... | |
ossimMapProjection * | createProjFromFormatARecord (ProjDbRecord *record) const |
Parses the "Spadac EPSG" Db record format and produces a projection (or NULL if invalid) More... | |
ossimMapProjection * | createProjFromFormatBRecord (ProjDbRecord *record) const |
Parses the State Plane Db record format and produce a projection (or NULL if invalid) More... | |
ossimMapProjection * | createProjFromUtmCode (ossim_uint32 code) const |
HACKUTM projections as specified in the EPSG are indistinguishable from regular TM. More... | |
void | initialize () const |
Populates the database with contents of DB files as specified in ossim_preferences. More... | |
![]() | |
virtual | ~ossimReferenced () |
Protected Attributes | |
std::multimap< ossim_uint32, ossimRefPtr< ProjDbRecord > > | m_projDatabase |
std::mutex | m_mutex |
Friends | |
class | ossimEpsgProjectionFactory |
Projection Database for coded projections defined in database files and specified via some coordinate reference system group:code, such as EPSG:26715.
Definition at line 29 of file ossimEpsgProjectionDatabase.h.
|
protected |
Enumerator | |
---|---|
NOT_ASSIGNED | |
FORMAT_A | |
FORMAT_B | |
FORMAT_C | |
CUSTOM |
Definition at line 77 of file ossimEpsgProjectionDatabase.h.
|
virtual |
|
protected |
Constructor loads all Db files specified in the ossim prefs.
Constructor loads all DB CSV files specified in the ossim prefs.
Protected as part of singleton implementation.
Definition at line 180 of file ossimEpsgProjectionDatabase.cpp.
|
protected |
Parses the "Spadac EPSG" Db record format and produces a projection (or NULL if invalid)
This method is invoked to parse the Db record and produce a projection (or NULL if spec invalid)
Definition at line 624 of file ossimEpsgProjectionDatabase.cpp.
References A_DATUM_CODE, A_FALSE_EASTING, A_FALSE_NORTHING, A_FALSE_ORG_EASTING, A_FALSE_ORG_LAT, A_FALSE_ORG_LON, A_FALSE_ORG_NORTHING, A_NAT_ORG_LAT, A_NAT_ORG_LON, A_NAT_ORG_SCALE, A_PROJ_TYPE, A_STD_PARL_1_LAT, A_STD_PARL_2_LAT, A_UNITS, ossimEpsgProjectionDatabase::ProjDbRecord::code, ossimString::contains(), ossimEpsgDatumFactory::create(), ossimDatumFactory::create(), ossimEpsgProjectionDatabase::ProjDbRecord::csvRecord, ossimEpsgProjectionDatabase::ProjDbRecord::datumValid, decodeSexagesimalDms(), ossimDatum::ellipsoid(), ossimRefPtr< T >::get(), ossimEpsgDatumFactory::instance(), ossimDatumFactory::instance(), ossimGpt::lat, ossimGpt::lon, MTRS_PER_FT, OSSIM_FEET, OSSIM_KILOMETERS, OSSIM_METERS, OSSIM_US_SURVEY_FEET, ossimEpsgProjectionDatabase::ProjDbRecord::proj, ossimMapProjection::setDatum(), ossimNewZealandMapGridProjection::setFalseEastingNorthing(), ossimMapProjection::setOrigin(), ossimMapProjection::setPcsCode(), ossimMapProjection::setProjectionUnits(), and US_METERS_PER_FT.
Referenced by findProjection().
|
protected |
Parses the State Plane Db record format and produce a projection (or NULL if invalid)
State Plane projections as specified in the EPSG are indistinguishable from regular TM.
Unfortunately OSSIM does make a distinction. For the time being, parse the code and programmatically arrive at the UTM projection.
Definition at line 797 of file ossimEpsgProjectionDatabase.cpp.
References B_CODE, B_DATUM_CODE, B_FALSE_EASTING, B_FALSE_NORTHING, B_PARAM1, B_PARAM2, B_PARAM3, B_PARAM4, B_PROJ_TYPE, B_UNITS, ossimEpsgProjectionDatabase::ProjDbRecord::code, ossimEpsgProjectionDatabase::ProjDbRecord::csvRecord, ossimEpsgProjectionDatabase::ProjDbRecord::datumValid, ossimRefPtr< T >::get(), ossimMapProjectionFactory::instance(), ossimEpsgProjectionDatabase::ProjDbRecord::name, ossimKeywordNames::PCS_CODE_KW, ossimEpsgProjectionDatabase::ProjDbRecord::proj, PTR_CAST, ossimKeywordlist::remove(), ossimMapProjection::setPcsCode(), and ossimRefPtr< T >::valid().
Referenced by findProjection().
|
protected |
UTM projections as specified in the EPSG are indistinguishable from regular TM.
Unfortunately OSSIM does make a distinction. For the time being, parse the code and programmatically arrives at the UTM projection.
Unfortunately OSSIM does make a distinction. For the time being, parse the code and programmatically arrive at the UTM projection.
Definition at line 837 of file ossimEpsgProjectionDatabase.cpp.
References ossimDatumFactory::instance(), ossimMapProjection::setDatum(), ossimUtmProjection::setHemisphere(), ossimMapProjection::setPcsCode(), and ossimUtmProjection::setZone().
Referenced by findProjection().
ossimProjection * ossimEpsgProjectionDatabase::findProjection | ( | const ossimString & | spec | ) | const |
Returns a projection corresponding to the projection specified, or NULL if no entry found.
Returns a projection corresponding to the group (e.g., "EPSG") and PCS code provided, or NULL if no entry found.
Normally <proj_spec> takes the form of <group>: (e.g., "EPSG:26715"). Other forms accepted are
(assumed EPSG), or <proj_name> to match a name in the database.
Definition at line 420 of file ossimEpsgProjectionDatabase.cpp.
References ossimString::after(), ossimString::before(), ossimEpsgProjectionDatabase::ProjDbRecord::code, ossimString::contains(), ossimDatumFactoryRegistry::create(), ossimString::downcase(), ossimProjection::dup(), ossimDatum::ellipsoid(), initialize(), ossimDatumFactoryRegistry::instance(), m_projDatabase, ossimEpsgProjectionDatabase::ProjDbRecord::name, ossimEpsgProjectionDatabase::ProjDbRecord::proj, ossimMapProjection::setDatum(), ossimMapProjection::setPcsCode(), ossimString::split(), ossimString::toUInt32(), and ossimRefPtr< T >::valid().
Referenced by ossimEpsgProjectionFactory::createProjection(), ossimWktProjectionFactory::createProjection(), and findProjectionCode().
ossimProjection * ossimEpsgProjectionDatabase::findProjection | ( | ossim_uint32 | epsg_code | ) | const |
Returns a projection corresponding to the epsg code specified, or NULL if no entry found.
Returns a projection corresponding to the group (e.g., "EPSG") and PCS code provided, or NULL if no entry found.
Definition at line 332 of file ossimEpsgProjectionDatabase.cpp.
References createProjFromFormatARecord(), createProjFromFormatBRecord(), createProjFromUtmCode(), ossimEpsgProjectionDatabase::ProjDbRecord::csvFormat, ossimEpsgProjectionDatabase::ProjDbRecord::csvRecord, ossimEpsgProjectionDatabase::ProjDbRecord::datumValid, ossimProjection::dup(), FORMAT_A, FORMAT_B, ossimRefPtr< T >::get(), initialize(), m_mutex, m_projDatabase, NOT_ASSIGNED, ossimEpsgProjectionDatabase::ProjDbRecord::proj, ossimMapProjection::setPcsCode(), and ossimRefPtr< T >::valid().
ossim_uint32 ossimEpsgProjectionDatabase::findProjectionCode | ( | const ossimString & | proj_name | ) | const |
Given a projection name, assigns the group (e.g., "EPSG") and code of the projection.
Returns integer EPSG code if match was found or 0 if not found.
Returns "<group>:<code>" if match was found or empty string if not found.
Definition at line 494 of file ossimEpsgProjectionDatabase.cpp.
References ossimEpsgProjectionDatabase::ProjDbRecord::code, ossimRefPtr< T >::get(), initialize(), m_projDatabase, ossimEpsgProjectionDatabase::ProjDbRecord::name, and ossimRefPtr< T >::valid().
Referenced by ossimOgcWktTranslator::fromOssimKwl(), and ossimMapProjection::getPcsCode().
ossim_uint32 ossimEpsgProjectionDatabase::findProjectionCode | ( | const ossimMapProjection & | lost_proj | ) | const |
Given a projection instance, this method determines the corresponding EPSG code.
Obviously this is only needed if the projection does not have its PCS code assigned (it is NULL). This happens when the projection was constructed with full parameters instead of the EPSG code. Returns integer EPSG code if match was found or 0 if not found.
Definition at line 520 of file ossimEpsgProjectionDatabase.cpp.
References ossimEpsgProjectionDatabase::ProjDbRecord::code, ossimDatum::epsgCode(), findProjection(), ossimRefPtr< T >::get(), ossimObject::getClassName(), getCodeFromUtmProj(), ossimMapProjection::getDatum(), initialize(), m_projDatabase, ossimEpsgProjectionDatabase::ProjDbRecord::proj, and ossimRefPtr< T >::valid().
ossimString ossimEpsgProjectionDatabase::findProjectionName | ( | ossim_uint32 | epsg_code | ) | const |
This method provides acess to the projection name given the EPSG code.
This method provides acess to the projection name given the EPSG code. The name provides enough info for recognizing a non-meters HARN-based projection.
The name provides enough info for recognizing a non-meters HARN-based projection.
Definition at line 573 of file ossimEpsgProjectionDatabase.cpp.
References initialize(), and m_projDatabase.
Referenced by ossimOgcWktTranslator::fromOssimKwl().
ossim_uint32 ossimEpsgProjectionDatabase::getCodeFromUtmProj | ( | const ossimUtmProjection * | proj | ) | const |
Given UTM projection, derives the associated EPSG code. This is faster than a Db lookup.
Definition at line 950 of file ossimEpsgProjectionDatabase.cpp.
References ossimDatum::code(), ossimMapProjection::getDatum(), ossimUtmProjection::getHemisphere(), and ossimUtmProjection::getZone().
Referenced by findProjectionCode(), and ossimUtmProjection::getPcsCode().
void ossimEpsgProjectionDatabase::getProjectionsList | ( | std::vector< ossimString > & | list | ) | const |
Populates caller's list with all projections currently represented in the database.
The format is: EPSG: "<Name as appears in Db>" There may be duplicate entries if the projection is duplicated in the various Db files.
Definition at line 594 of file ossimEpsgProjectionDatabase.cpp.
References ossimEpsgProjectionDatabase::ProjDbRecord::code, initialize(), m_projDatabase, ossimEpsgProjectionDatabase::ProjDbRecord::name, ossimString::push_back(), ossimString::toString(), and ossimRefPtr< T >::valid().
Referenced by ossimEpsgProjectionFactory::getTypeNameList().
|
protected |
Populates the database with contents of DB files as specified in ossim_preferences.
Definition at line 190 of file ossimEpsgProjectionDatabase.cpp.
References ossimString::chars(), ossimString::clear(), ossimFilename::dirCat(), ossimKeywordlist::findKey(), getline(), ossimKeywordlist::getSubstringKeyList(), ossimPreferences::instance(), ossimFilename::isReadable(), ossimFilename::isRelative(), ossimPreferences::preferencesKWL(), ossimString::size(), ossimString::string(), and ossimString::trim().
Referenced by findProjection(), findProjectionCode(), findProjectionName(), and getProjectionsList().
|
static |
Instantiates singleton instance of this class:
Implements singleton pattern.
Definition at line 160 of file ossimEpsgProjectionDatabase.cpp.
Referenced by ossimEpsgProjectionFactory::createProjection(), ossimWktProjectionFactory::createProjection(), ossimOgcWktTranslator::fromOssimKwl(), ossimUtmProjection::getPcsCode(), ossimMapProjection::getPcsCode(), ossimGeoTiff::getPcsUnitType(), ossimTiffWriter::getPcsUnitType(), and ossimEpsgProjectionFactory::getTypeNameList().
|
inline |
ENGINEERING CODE. Used for testing.
Definition at line 71 of file ossimEpsgProjectionDatabase.h.
|
friend |
Definition at line 31 of file ossimEpsgProjectionDatabase.h.
|
mutableprotected |
Definition at line 126 of file ossimEpsgProjectionDatabase.h.
Referenced by findProjection().
|
mutableprotected |
Definition at line 125 of file ossimEpsgProjectionDatabase.h.
Referenced by findProjection(), findProjectionCode(), findProjectionName(), and getProjectionsList().