OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimEpsgProjectionDatabase.h
Go to the documentation of this file.
1 //*************************************************************************************************
2 // OSSIM -- Open Source Software Image Map
3 //
4 // License: See top level LICENSE.txt file.
5 //
6 // Author: Oscar Kramer
7 //
8 //*************************************************************************************************
9 // $Id: ossimEpsgProjectionDatabase.h 22924 2014-10-27 16:32:58Z okramer $
10 
11 #ifndef ossimEpsgProjectionDatabase_HEADER
12 #define ossimEpsgProjectionDatabase_HEADER 1
13 
17 #include <fstream>
18 #include <mutex>
19 
20 class ossimProjection;
21 class ossimString;
23 class ossimUtmProjection;
24 
25 //*************************************************************************************************
28 //*************************************************************************************************
30 {
32 
33 public:
36 
38  virtual ~ossimEpsgProjectionDatabase();
39 
43  ossimProjection* findProjection(const ossimString& proj_spec) const;
44 
46  ossimProjection* findProjection(ossim_uint32 epsg_code) const;
47 
50  ossim_uint32 findProjectionCode(const ossimString& projection_name) const;
51 
56  ossim_uint32 findProjectionCode(const ossimMapProjection& lost_proj) const;
57 
62  ossimString findProjectionName(ossim_uint32 epsg_code) const;
63 
68  void getProjectionsList(std::vector<ossimString>& typeList) const;
69 
71  size_t numRecords() const { return m_projDatabase.size(); }
72 
74  ossim_uint32 getCodeFromUtmProj(const ossimUtmProjection* proj) const;
75 
76 protected:
78  {
79  NOT_ASSIGNED=0,
83  CUSTOM
84  };
85 
89  {
90  public:
92  code(0),
93  name(""),
94  datumValid(false),
95  csvFormat(NOT_ASSIGNED),
96  proj(0) {}
97 
100  bool datumValid;
102  std::vector<ossimString> csvRecord;
104  };
105 
109 
111  ossimMapProjection* createProjFromFormatARecord(ProjDbRecord* record) const;
112 
114  ossimMapProjection* createProjFromFormatBRecord(ProjDbRecord* record) const;
115 
120  ossimMapProjection* createProjFromUtmCode(ossim_uint32 code) const;
121 
123  void initialize() const;
124 
125  mutable std::multimap<ossim_uint32, ossimRefPtr<ProjDbRecord> > m_projDatabase;
126  mutable std::mutex m_mutex;
127  //static ossimEpsgProjectionDatabase* m_instance; //!< Singleton implementation
128 
129 };
130 
131 #endif
#define OSSIMDLLEXPORT
bool datumValid
FALSE if the datum code was not parsed and WGS84 defaulted.
Type for database record consists of EPSG code and serialized form of corresponding OSSIM projection ...
ossimReferenced allows for shared object ref counting if the reference count ever gets to 0 or less i...
size_t numRecords() const
ENGINEERING CODE. Used for testing.
Projection Database for coded projections defined in database files and specified via some coordinate...
unsigned int ossim_uint32
std::multimap< ossim_uint32, ossimRefPtr< ProjDbRecord > > m_projDatabase
static ossimEpsgProjectionFactory * instance()
Implements singleton pattern.
Projection Factory for coded projections defined in database.