OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimVpfCoverage.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 // License: See top level LICENSE.txt file.
3 //
4 // Author: Garrett Potts
5 //
6 // Description: This class extends the stl's string class.
7 //
8 //********************************************************************
9 // $Id: ossimVpfCoverage.cpp 23244 2015-04-08 20:48:34Z rashadkm $
10 #include <algorithm>
11 using namespace std;
12 
18 
20  :theLibrary(NULL),
21  theCoverageName(""),
22  theCoverageNameFullPath("")
23 {
24 }
25 
27 {
28  theLibrary = NULL;
29 }
30 
32  const ossimString& name,
33  const ossimFilename& fullPath)
34 {
35  bool result = true;
36  theCoverageName = name;
37  theCoverageNameFullPath = fullPath;
38  theLibrary = library;
39 
41  {
42  result = false;
43  }
44 
45  return result;
46 }
47 
49 {
51 }
52 
54 {
55  return theCoverageName;
56 }
57 
59 {
60  ossimVpfTable table;
61  if(table.openTable(theCoverageNameFullPath.dirCat("fcs")))
62  {
63  table.print(out);
64  }
65 }
66 
68 {
69  bool result = false;
70  bool firstOneSetFlag = false;
71  ossimVpfExtent resultExtent;
72  ossimVpfExtent tempExtent;
73  if(theLibrary)
74  {
76  {
77  ossimVpfBoundingRecordTable boundingRecord;
78 
79  if(boundingRecord.openTable(theCoverageNameFullPath.dirCat("ebr")))
80  {
81  boundingRecord.getExtent(tempExtent);
82  resultExtent = tempExtent;
83  firstOneSetFlag = true;
84  result = true;
85  }
86  }
88  {
89  ossimVpfBoundingRecordTable boundingRecord;
90 
91  if(boundingRecord.openTable(theCoverageNameFullPath.dirCat("fbr")))
92  {
93  boundingRecord.getExtent(tempExtent);
94 
95  if(!firstOneSetFlag)
96  {
97  resultExtent = tempExtent;
98  firstOneSetFlag = true;
99  }
100  else
101  {
102  resultExtent = resultExtent + tempExtent;
103  }
104 
105  result = true;
106  }
107  }
108  std::vector<ossimString> tileNames;
109 
110  theLibrary->getTileNames(tileNames);
111 
112  for(int i = 0; i < (int)tileNames.size(); ++i)
113  {
114  ossimFilename tileName = tileNames[0];
115  ossimFilename tileDir;
116  if(theCoverageNameFullPath.dirCat(tileName).exists())
117  {
118  tileDir = theCoverageNameFullPath.dirCat(tileName);
119  }
120  else if(theCoverageNameFullPath.dirCat(tileName.downcase()).exists())
121  {
122  tileDir = theCoverageNameFullPath.dirCat(tileName.downcase());
123  }
124  if(tileDir != "")
125  {
126  if(tileDir.dirCat("ebr").exists())
127  {
128  ossimVpfBoundingRecordTable boundingRecord;
129 
130  if(boundingRecord.openTable(tileDir.dirCat("ebr")))
131  {
132  boundingRecord.getExtent(tempExtent);
133 
134  if(!firstOneSetFlag)
135  {
136  resultExtent = tempExtent;
137  firstOneSetFlag = true;
138  }
139  else
140  {
141  resultExtent = resultExtent + tempExtent;
142  }
143 
144  result = true;
145  }
146  }
147  if(tileDir.dirCat("fbr").exists())
148  {
149  ossimVpfBoundingRecordTable boundingRecord;
150 
151  if(boundingRecord.openTable(tileDir.dirCat("fbr")))
152  {
153  boundingRecord.getExtent(tempExtent);
154 
155  if(!firstOneSetFlag)
156  {
157  resultExtent = tempExtent;
158  firstOneSetFlag = true;
159  }
160  else
161  {
162  resultExtent = resultExtent + tempExtent;
163  }
164 
165  result = true;
166  }
167  }
168  }
169  }
170  }
171 
172  extent = resultExtent;
173 
174  return result;
175 }
176 
178 {
179  return theLibrary;
180 }
181 
183 {
184  if(!schema.isClosed()) schema.closeTable();
185 
186  return schema.openSchema(this);
187 }
ossimVpfLibrary * theLibrary
virtual bool openTable(const ossimFilename &tableName)
bool openSchema(ossimVpfCoverage *coverage)
bool openCoverage(ossimVpfLibrary *library, const ossimString &name, const ossimFilename &fileName)
bool openFeatureClassSchema(ossimVpfFeatureClassSchema &schema)
void print(ostream &out) const
void getTileNames(std::vector< ossimString > &tileNames) const
virtual bool openTable(const ossimFilename &tableName)
bool getExtent(ossimVpfExtent &extent) const
virtual bool isClosed() const
const ossimFilename & getPath() const
bool exists() const
ossimString theCoverageName
static ossimString downcase(const ossimString &aString)
Definition: ossimString.cpp:48
virtual ~ossimVpfCoverage()
const ossimString & getName() const
ossimFilename theCoverageNameFullPath
void getExtent(ossimVpfExtent &extent) const
ossimFilename dirCat(const ossimFilename &file) const
virtual void print(std::ostream &out) const
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
ossimVpfLibrary * getLibrary()