OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimDoqqTileSource.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2000 ImageLinks Inc.
3 //
4 // License: LGPL
5 //
6 // See LICENSE.txt file in the top level directory for more details.
7 //
8 // Author: Garrett Potts
9 //
10 //*******************************************************************
11 // $Id: ossimDoqqTileSource.cpp 21631 2012-09-06 18:10:55Z dburken $
20 
22  "ossimDoqqTileSource",
24 
26  :theHeaderInformation(0)
27 {
28 }
29 
31 {
33 }
34 
36 {
37  bool result = false;
38 
39  theHeaderInformation = new ossimDoqq(filename);
41  {
43 
44  return result;
45  }
46  else
47  {
48  // Set the Acquisition Date
50  theAcqDate += "-";
52  theAcqDate += "-";
54 
55  vector<ossimFilename> f;
56  f.push_back(filename);
57  ossimGeneralRasterInfo genRasterInfo(f,
59  OSSIM_BIP,
65  0);
66 
67  result = ossimGeneralRasterTileSource::open(genRasterInfo);
68  }
69 
70  return result;
71 }
72 
73 //**************************************************************************************************
76 //**************************************************************************************************
78 {
79  if (theGeometry.valid()) return theGeometry;
80 
82  {
83  ossimKeywordlist kwl;
84  const char* prefix = 0; // legacy
85 
88 
89  if(proj == ossimString("UTM") || proj == ossimString("1"))
90  {
91  kwl.add(prefix,
93  "ossimUtmProjection",
94  true);
95  kwl.add(prefix,
98  true);
99  }
100  else
101  {
103  }
104 
105  if(datum == ossimString("NAR") || datum == ossimString("4"))
106  {
107  kwl.add(prefix,
109  "NAR-C", // North American Conus 1983
110  true);
111  }
112  else if(datum == ossimString("NAS") || datum == ossimString("1"))
113  {
114  kwl.add(prefix,
116  "NAS-C", // North American Conus 1927
117  true);
118  }
119  else if(datum == ossimString("2"))
120  {
121  kwl.add(prefix,
123  "WGD", // WGS 72
124  true);
125  }
126  else if(datum == ossimString("3"))
127  {
128  kwl.add(prefix,
130  "WGE", // WGS 84
131  true);
132  }
133  else
134  {
136  }
137 
138  kwl.add(prefix,
141  true);
142 
143  kwl.add(prefix,
146  true);
147  kwl.add(prefix,
149 // theHeaderInformation->theUE + (theHeaderInformation->theGsd/2.0),
151  true);
152 
153  kwl.add(prefix,
155 // theHeaderInformation->theUN - (theHeaderInformation->theGsd/2.0),
157  true);
158 
159  // Capture this for next time.
161  theGeometry->loadState(kwl, prefix);
162 
163  // Set image things the geometry object should know about.
165 
166  return theGeometry;
167  }
169 }
170 
172 {
173  if(name == "acquisition_date")
174  {
176  {
177  std::stringstream out;
178  out << std::setw(4) << std::setfill(' ') << theHeaderInformation->theAcqYear.c_str()
179  << std::setw(2) << setfill('0') << theHeaderInformation->theAcqMonth.c_str()
180  << std::setw(2) << setfill('0') << theHeaderInformation->theAcqDay.c_str();
181  return new ossimStringProperty("acquisition_date", out.str());
182  }
183  return 0;
184  }
185  else if(name == "file_type")
186  {
187  return new ossimStringProperty("file_type", "DOQQ");
188  }
189  return ossimImageHandler::getProperty(name);
190 }
191 
192 void ossimDoqqTileSource::getPropertyNames(std::vector<ossimString>& propertyNames)const
193 {
195  propertyNames.push_back("acquisition_date");
196  propertyNames.push_back("file_type");
197 
198 }
199 
201  const char* prefix)
202 {
203  const char* lookup = kwl.find(prefix, ossimKeywordNames::FILENAME_KW);
204  if(!ossimImageHandler::loadState(kwl, prefix))
205  {
206  return false;
207  }
208 
209  if(lookup)
210  {
213  {
215  return false;
216  }
217  else
218  {
219  ossimFilename filename(lookup);
220  vector<ossimFilename> f;
221  f.push_back(filename);
222  ossimGeneralRasterInfo genRasterInfo(f,
223  OSSIM_UCHAR,
224  OSSIM_BIP,
230  0);
231  return open(genRasterInfo);
232  }
233  }
234  else
235  {
236  return false;
237  }
238 
239  return true;
240 }
241 
243 {
244  return ossimString("doqq");
245 }
246 
248 {
249  return ossimString("doqq handler");
250 }
251 
253 {
255 }
256 
258 {
259  return theAcqDate;
260 }
ossimRefPtr< ossimImageGeometry > theGeometry
virtual bool open()
Pure virtual open.
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
ossim_float64 theEasting
Definition: ossimDoqq.h:111
std::basic_stringstream< char > stringstream
Class for char mixed input and output memory streams.
Definition: ossimIosFwd.h:38
static const char * DATUM_KW
Represents serializable keyword/value map.
bool valid() const
Definition: ossimRefPtr.h:75
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Attempts to initialize a transform and a projection given the KWL.
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
Gets a property for matching name.
const char * find(const char *key) const
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
double y
Definition: ossimDpt.h:165
ossim_int32 theUtmZone
Definition: ossimDoqq.h:99
ossimString theDatum
Definition: ossimDoqq.h:88
ossimDpt theGsd
Definition: ossimDoqq.h:117
static const char * METERS_PER_PIXEL_Y_KW
static const char * TYPE_KW
static const char * TIE_POINT_NORTHING_KW
void push_back(char c)
Equivalent to insert(end(), c).
Definition: ossimString.h:905
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
ossim_int32 theLine
Definition: ossimDoqq.h:100
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
ossimString getLongName() const
static const char * ZONE_KW
virtual ossimRefPtr< ossimImageGeometry > getImageGeometry()
Returns the image geometry object associated with this tile source or NULL if non defined...
static const char * TIE_POINT_EASTING_KW
ossimString theProjection
Definition: ossimDoqq.h:87
ossimString trim(const ossimString &valueToTrim=ossimString(" \\)) const
this will strip lead and trailing character passed in.
ossimString getShortName() const
ossim_int32 theHeaderSize
Definition: ossimDoqq.h:118
void initImageParameters(ossimImageGeometry *geom) const
Convenience method to set things needed in the image geometry from the image handler.
Container class that holds both 2D transform and 3D projection information for an image Only one inst...
virtual void getPropertyNames(std::vector< ossimString > &propertyNames) const
Gets a list of property names available.
virtual ossimRefPtr< ossimProperty > getProperty(const ossimString &name) const
ossim_float64 theNorthing
Definition: ossimDoqq.h:112
ossimRefPtr< ossimDoqq > theHeaderInformation
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=NULL)
Method to the load (recreate) the state of an object from a keyword list.
ossim_int32 theSample
Definition: ossimDoqq.h:101
ossimString acqdate() const
double x
Definition: ossimDpt.h:164
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string&#39;s contents...
Definition: ossimString.h:396
ossimString theAcqMonth
Definition: ossimDoqq.h:105
ossimString theAcqYear
Definition: ossimDoqq.h:104
static const char * FILENAME_KW
static const char * METERS_PER_PIXEL_X_KW
ossim_int32 theRgb
Definition: ossimDoqq.h:102
RTTI_DEF1(ossimDoqqTileSource, "ossimDoqqTileSource", ossimGeneralRasterTileSource)
8 bit unsigned iteger
ossim_int32 errorStatus() const
Definition: ossimDoqq.h:121
ossimString theAcqDay
Definition: ossimDoqq.h:106