OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Private Attributes | Friends | List of all members
ossimGpkgTileEntry Class Reference

#include <ossimGpkgTileEntry.h>

Public Member Functions

 ossimGpkgTileEntry ()
 default constructor More...
 
 ossimGpkgTileEntry (const ossimGpkgTileEntry &obj)
 
const ossimGpkgTileEntryoperator= (const ossimGpkgTileEntry &obj)
 
 ~ossimGpkgTileEntry ()
 destructor More...
 
void setTileMatrixSet (const ossimGpkgTileMatrixSetRecord &set)
 Sets the tile matrix set. More...
 
const ossimGpkgTileMatrixSetRecordgetTileMatrixSet () const
 
void setSrs (const ossimGpkgSpatialRefSysRecord &srs)
 Sets the spatial ref sys. More...
 
const ossimGpkgSpatialRefSysRecordgetSrs () const
 Spatial ref sys. More...
 
void addTileMatrix (const ossimGpkgTileMatrixRecord &level)
 Adds a tile matrix level to array. More...
 
const std::vector< ossimGpkgTileMatrixRecord > & getTileMatrix () const
 
void addTileMatrixExtent (const ossimGpkgNsgTileMatrixExtentRecord &record)
 Adds a tile matrix extent level to array. More...
 
const std::vector< ossimGpkgNsgTileMatrixExtentRecord > & getTileMatrixExtent () const
 
void sortTileMatrix ()
 Sorts the m_tileMatrix by zoom levels with the highest zoom level being at the lowest array index. More...
 
void sortTileMatrixExtents ()
 Sorts the m_tileMatrixExtents by zoom levels with the highest zoom level being at the lowest array index. More...
 
void saveState (ossimKeywordlist &kwl, const std::string &prefix) const
 Saves the state of object. More...
 
ossim_uint32 getNumberOfLines (ossim_uint32 resLevel) const
 
ossim_uint32 getNumberOfSamples (ossim_uint32 resLevel) const
 
void getSubImageOffset (ossim_uint32 resLevel, ossimIpt &offset) const
 
void getTiePoint (ossimDpt &offset) const
 Gets the tie point from the first tile matrix extents if initialized else from the tile matrix extents. More...
 
void getGsd (ossim_uint32 index, ossimDpt &gsd) const
 Gets the gsd from tile matrix. More...
 
void getZoomLevels (std::vector< ossim_int32 > &zoomLevels) const
 Gets zoom levels of all tile matrixes. More...
 
void getZoomLevelMatrixSizes (std::vector< ossimIpt > &zoomLevelMatrixSizes) const
 Gets zoom level matrix of all tile matrixes. More...
 
ossimRefPtr< ossimMapProjectiongetNewMapProjection () const
 Gets the map projection to include setting the tie and scale. More...
 
std::ostream & print (std::ostream &out) const
 Print method. More...
 
std::ostream & printValidate (std::ostream &out) const
 Validate method. More...
 

Private Attributes

ossimGpkgSpatialRefSysRecord m_srs
 
ossimGpkgTileMatrixSetRecord m_tileMatrixSet
 
std::vector< ossimGpkgTileMatrixRecordm_tileMatrix
 
std::vector< ossimGpkgNsgTileMatrixExtentRecordm_tileMatrixExtents
 

Friends

std::ostream & operator<< (std::ostream &out, const ossimGpkgTileEntry &obj)
 Convenience operator << function. More...
 

Detailed Description

Definition at line 34 of file ossimGpkgTileEntry.h.

Constructor & Destructor Documentation

◆ ossimGpkgTileEntry() [1/2]

ossimGpkgTileEntry::ossimGpkgTileEntry ( )

default constructor

Definition at line 48 of file ossimGpkgTileEntry.cpp.

49  :
50  m_srs(),
52  m_tileMatrix(0),
54 {
55 }
std::vector< ossimGpkgNsgTileMatrixExtentRecord > m_tileMatrixExtents
ossimGpkgTileMatrixSetRecord m_tileMatrixSet
ossimGpkgSpatialRefSysRecord m_srs
std::vector< ossimGpkgTileMatrixRecord > m_tileMatrix

◆ ossimGpkgTileEntry() [2/2]

ossimGpkgTileEntry::ossimGpkgTileEntry ( const ossimGpkgTileEntry obj)

Definition at line 57 of file ossimGpkgTileEntry.cpp.

58  :
59  m_srs(obj.m_srs),
63 {
64 }
std::vector< ossimGpkgNsgTileMatrixExtentRecord > m_tileMatrixExtents
ossimGpkgTileMatrixSetRecord m_tileMatrixSet
ossimGpkgSpatialRefSysRecord m_srs
std::vector< ossimGpkgTileMatrixRecord > m_tileMatrix

◆ ~ossimGpkgTileEntry()

ossimGpkgTileEntry::~ossimGpkgTileEntry ( )

destructor

Definition at line 78 of file ossimGpkgTileEntry.cpp.

79 {
80 }

Member Function Documentation

◆ addTileMatrix()

void ossimGpkgTileEntry::addTileMatrix ( const ossimGpkgTileMatrixRecord level)

Adds a tile matrix level to array.

Parameters
levelLevel to add.

Definition at line 102 of file ossimGpkgTileEntry.cpp.

References m_tileMatrix.

Referenced by ossim_gpkg::getTileEntries(), and ossim_gpkg::getTileEntry().

103 {
104  m_tileMatrix.push_back( level );
105 }
std::vector< ossimGpkgTileMatrixRecord > m_tileMatrix

◆ addTileMatrixExtent()

void ossimGpkgTileEntry::addTileMatrixExtent ( const ossimGpkgNsgTileMatrixExtentRecord record)

Adds a tile matrix extent level to array.

Parameters
levelLevel to add.

Definition at line 112 of file ossimGpkgTileEntry.cpp.

References m_tileMatrixExtents.

Referenced by ossim_gpkg::getTileEntries(), and ossim_gpkg::getTileEntry().

113 {
114  m_tileMatrixExtents.push_back( record );
115 }
std::vector< ossimGpkgNsgTileMatrixExtentRecord > m_tileMatrixExtents

◆ getGsd()

void ossimGpkgTileEntry::getGsd ( ossim_uint32  index,
ossimDpt gsd 
) const

Gets the gsd from tile matrix.

Parameters
indexto tile matrix array.
gsdInitialized by this. Will be nan if matrix is empty.

Definition at line 303 of file ossimGpkgTileEntry.cpp.

References m_tileMatrix, ossimDpt::makeNan(), ossimDpt::x, and ossimDpt::y.

Referenced by getNewMapProjection().

304 {
305  if ( index < m_tileMatrix.size() )
306  {
307  gsd.x = m_tileMatrix[index].m_pixel_x_size;
308  gsd.y = m_tileMatrix[index].m_pixel_y_size;
309  }
310  else
311  {
312  gsd.makeNan();
313  }
314 }
double y
Definition: ossimDpt.h:165
double x
Definition: ossimDpt.h:164
std::vector< ossimGpkgTileMatrixRecord > m_tileMatrix
void makeNan()
Definition: ossimDpt.h:65

◆ getNewMapProjection()

ossimRefPtr< ossimMapProjection > ossimGpkgTileEntry::getNewMapProjection ( ) const

Gets the map projection to include setting the tie and scale.

Returns
Map projection. Result will be null if matrix is not intialized.

Definition at line 339 of file ossimGpkgTileEntry.cpp.

References ossim::acosd(), ossimEpsgProjectionFactory::createProjection(), ossimRefPtr< T >::get(), getGsd(), getTiePoint(), ossimEpsgProjectionFactory::instance(), ossimMapProjection::isGeographic(), ossim::isnan(), ossimDpt::lat, ossimGpt::lat, ossimDpt::lon, ossimGpt::lon, ossimGpkgSpatialRefSysRecord::m_organization, ossimGpkgSpatialRefSysRecord::m_organization_coordsys_id, m_srs, m_tileMatrix, ossimMapProjection::setDecimalDegreesPerPixel(), ossimMapProjection::setMetersPerPixel(), ossimMapProjection::setUlTiePoints(), ossimString::string(), ossimString::toString(), ossimString::upcase(), ossimRefPtr< T >::valid(), ossimDpt::x, and ossimDpt::y.

340 {
342 
343  if ( m_tileMatrix.size() )
344  {
345  // Must have code, and scale to continue:
347  m_tileMatrix[0].m_pixel_x_size &&
348  m_tileMatrix[0].m_pixel_y_size )
349  {
350  std::string org = ossimString(m_srs.m_organization).upcase().string();
351 
352  if ( org == "EPSG" )
353  {
355 
356  ossimDpt gsd;
357  getGsd( 0, gsd );
358 
359  // Avoid factory call for two most common projections.
360  if ( code == 4326 )
361  {
362  // Geographic, WGS 84
363 
364  //---
365  // ossimEquDistCylProjection uses the origin_latitude for meters per pixel
366  // (gsd) computation. Compute to achieve the proper horizontal sccaling.
367  //---
368  ossimGpt origin(0.0, 0.0);
369  ossim_float64 tmpDbl = ossim::acosd(gsd.y/gsd.x);
370  if ( !ossim::isnan(tmpDbl) )
371  {
372  origin.lat = tmpDbl;
373  }
374  mapProj = new ossimEquDistCylProjection(ossimEllipsoid(), origin);
375  }
376  else if ( ( code == 3857 ) || ( code == 900913) )
377  {
378  mapProj = new ossimGoogleProjection();
379  }
380  else
381  {
382  ossimString name = "EPSG:";
383  name += ossimString::toString(code);
386  if ( proj.valid() )
387  {
388  mapProj = dynamic_cast<ossimMapProjection*>( proj.get() );
389  }
390  }
391 
392  if ( mapProj.valid() )
393  {
394  //---
395  // Set the tie and scale. NOTE the tie is center of the upper left
396  // pixel; hence, the half pixel shif.
397  //---
398  ossimDpt tie;
399  getTiePoint( tie );
400 
401  if ( mapProj->isGeographic() )
402  {
403  mapProj->setDecimalDegreesPerPixel(gsd);
404 
405  // Tie latitude, longitude:
406  ossimGpt tiePoint( tie.y, tie.x );
407  ossimDpt half_pixel_shift = gsd * 0.5;
408  tiePoint.lat -= half_pixel_shift.lat;
409  tiePoint.lon += half_pixel_shift.lon;
410 
411  mapProj->setUlTiePoints(tiePoint);
412  }
413  else
414  {
415  mapProj->setMetersPerPixel(gsd);
416 
417  // Tie Easting Northing:
418  ossimDpt half_pixel_shift = gsd * 0.5;
419  tie.y -= half_pixel_shift.y;
420  tie.x += half_pixel_shift.x;
421 
422  mapProj->setUlTiePoints(tie);
423  }
424  }
425 
426  } // Matches: if ( org == "epsg" )
427 
428  } // Matches: if ( m_srs.m_organization_coordsys_id && ...
429 
430  } // Matches: if ( m_tileMatrix.size() )
431 
432  return mapProj;
433 
434 } // End: ossimGpkgTileEntry::getNewMapProjection()
static ossimString upcase(const ossimString &aString)
Definition: ossimString.cpp:34
bool valid() const
Definition: ossimRefPtr.h:75
double y
Definition: ossimDpt.h:165
static ossimString toString(bool aValue)
Numeric to string methods.
virtual bool isGeographic() const
void getGsd(ossim_uint32 index, ossimDpt &gsd) const
Gets the gsd from tile matrix.
double acosd(double x)
Definition: ossimCommon.h:264
virtual void setDecimalDegreesPerPixel(const ossimDpt &gsd)
virtual void setMetersPerPixel(const ossimDpt &gsd)
double ossim_float64
double lat
Definition: ossimDpt.h:165
unsigned int ossim_uint32
double lon
Definition: ossimDpt.h:164
void getTiePoint(ossimDpt &offset) const
Gets the tie point from the first tile matrix extents if initialized else from the tile matrix extent...
ossimGpkgSpatialRefSysRecord m_srs
double x
Definition: ossimDpt.h:164
virtual ossimProjection * createProjection(const ossimFilename &filename, ossim_uint32 entryIdx) const
STUB. Not implemented.
virtual void setUlTiePoints(const ossimGpt &gpt)
std::vector< ossimGpkgTileMatrixRecord > m_tileMatrix
static ossimEpsgProjectionFactory * instance()
Implements singleton pattern.
const std::string & string() const
Definition: ossimString.h:414
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91

◆ getNumberOfLines()

ossim_uint32 ossimGpkgTileEntry::getNumberOfLines ( ossim_uint32  resLevel) const

Definition at line 214 of file ossimGpkgTileEntry.cpp.

References ossimGpkgTileMatrixSetRecord::m_max_y, ossimGpkgTileMatrixSetRecord::m_min_y, m_tileMatrix, m_tileMatrixExtents, and m_tileMatrixSet.

215 {
216  ossim_uint32 result = 0;
217 
218  if ( resLevel < m_tileMatrix.size() )
219  {
220  // m_tileMatrixExtents may or may not be there.
221  if ( ( resLevel < m_tileMatrixExtents.size() ) &&
222  ( m_tileMatrixExtents[resLevel].m_zoom_level == m_tileMatrix[resLevel].m_zoom_level ) )
223  {
224  result = m_tileMatrixExtents[resLevel].m_max_row -
225  m_tileMatrixExtents[resLevel].m_min_row + 1;
226  }
227  else
228  {
229  ossim_float64 lines =
231  m_tileMatrix[resLevel].m_pixel_y_size;
232  if ( lines > 0.0 )
233  {
234  result = (ossim_uint32)(lines + 0.5);
235  }
236  }
237  }
238 
239  return result;
240 }
double ossim_float64
unsigned int ossim_uint32
std::vector< ossimGpkgNsgTileMatrixExtentRecord > m_tileMatrixExtents
ossimGpkgTileMatrixSetRecord m_tileMatrixSet
std::vector< ossimGpkgTileMatrixRecord > m_tileMatrix

◆ getNumberOfSamples()

ossim_uint32 ossimGpkgTileEntry::getNumberOfSamples ( ossim_uint32  resLevel) const

Definition at line 242 of file ossimGpkgTileEntry.cpp.

References ossimGpkgTileMatrixSetRecord::m_max_x, ossimGpkgTileMatrixSetRecord::m_min_x, m_tileMatrix, m_tileMatrixExtents, and m_tileMatrixSet.

243 {
244  ossim_uint32 result = 0;
245 
246  if ( resLevel < m_tileMatrix.size() )
247  {
248  // m_tileMatrixExtents may or may not be there.
249  if ( ( resLevel < m_tileMatrixExtents.size() ) &&
250  ( m_tileMatrixExtents[resLevel].m_zoom_level == m_tileMatrix[resLevel].m_zoom_level ) )
251  {
252  result = m_tileMatrixExtents[resLevel].m_max_column -
253  m_tileMatrixExtents[resLevel].m_min_column + 1;
254  }
255  else
256  {
257  ossim_float64 samples =
259  m_tileMatrix[resLevel].m_pixel_x_size;
260  if ( samples > 0.0 )
261  {
262  result = (ossim_uint32)(samples + 0.5);
263  }
264  }
265  }
266 
267  return result;
268 }
double ossim_float64
unsigned int ossim_uint32
std::vector< ossimGpkgNsgTileMatrixExtentRecord > m_tileMatrixExtents
ossimGpkgTileMatrixSetRecord m_tileMatrixSet
std::vector< ossimGpkgTileMatrixRecord > m_tileMatrix

◆ getSrs()

const ossimGpkgSpatialRefSysRecord & ossimGpkgTileEntry::getSrs ( ) const

Spatial ref sys.

Definition at line 97 of file ossimGpkgTileEntry.cpp.

References m_srs.

Referenced by ossimGpkgWriter::addLevels().

98 {
99  return m_srs;
100 }
ossimGpkgSpatialRefSysRecord m_srs

◆ getSubImageOffset()

void ossimGpkgTileEntry::getSubImageOffset ( ossim_uint32  resLevel,
ossimIpt offset 
) const

Definition at line 270 of file ossimGpkgTileEntry.cpp.

References m_tileMatrix, m_tileMatrixExtents, ossimIpt::x, and ossimIpt::y.

271 {
272  // m_tileMatrixExtents may or may not be there.
273  if ( ( resLevel < m_tileMatrix.size() ) &&
274  ( resLevel < m_tileMatrixExtents.size() ) &&
275  ( m_tileMatrixExtents[resLevel].m_zoom_level == m_tileMatrix[resLevel].m_zoom_level ) )
276  {
277  offset.x = m_tileMatrixExtents[resLevel].m_min_column;
278  offset.y = m_tileMatrixExtents[resLevel].m_min_row;
279  }
280  else
281  {
282  offset.x = 0;
283  offset.y = 0;
284  }
285 }
std::vector< ossimGpkgNsgTileMatrixExtentRecord > m_tileMatrixExtents
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
std::vector< ossimGpkgTileMatrixRecord > m_tileMatrix

◆ getTiePoint()

void ossimGpkgTileEntry::getTiePoint ( ossimDpt offset) const

Gets the tie point from the first tile matrix extents if initialized else from the tile matrix extents.

Definition at line 287 of file ossimGpkgTileEntry.cpp.

References ossimGpkgTileMatrixSetRecord::m_max_y, ossimGpkgTileMatrixSetRecord::m_min_x, m_tileMatrix, m_tileMatrixExtents, m_tileMatrixSet, ossimDpt::x, and ossimDpt::y.

Referenced by getNewMapProjection().

288 {
289  // m_tileMatrixExtents may or may not be there.
290  if ( m_tileMatrix.size() && m_tileMatrixExtents.size() &&
291  ( m_tileMatrixExtents[0].m_zoom_level == m_tileMatrix[0].m_zoom_level ) )
292  {
293  tie.x = m_tileMatrixExtents[0].m_min_x;
294  tie.y = m_tileMatrixExtents[0].m_max_y;
295  }
296  else
297  {
298  tie.x = m_tileMatrixSet.m_min_x;
299  tie.y = m_tileMatrixSet.m_max_y;
300  }
301 }
std::vector< ossimGpkgNsgTileMatrixExtentRecord > m_tileMatrixExtents
ossimGpkgTileMatrixSetRecord m_tileMatrixSet
std::vector< ossimGpkgTileMatrixRecord > m_tileMatrix

◆ getTileMatrix()

const std::vector< ossimGpkgTileMatrixRecord > & ossimGpkgTileEntry::getTileMatrix ( ) const
Returns
const reference to the tile matrix.

Definition at line 107 of file ossimGpkgTileEntry.cpp.

References m_tileMatrix.

Referenced by ossim_gpkg::getTileEntries(), and ossim_gpkg::getTileEntry().

108 {
109  return m_tileMatrix;
110 }
std::vector< ossimGpkgTileMatrixRecord > m_tileMatrix

◆ getTileMatrixExtent()

const std::vector< ossimGpkgNsgTileMatrixExtentRecord > & ossimGpkgTileEntry::getTileMatrixExtent ( ) const
Returns
const reference to the tile matrix extent.

Definition at line 118 of file ossimGpkgTileEntry.cpp.

References m_tileMatrixExtents.

Referenced by ossim_gpkg::getTileEntry().

119 {
120  return m_tileMatrixExtents;
121 }
std::vector< ossimGpkgNsgTileMatrixExtentRecord > m_tileMatrixExtents

◆ getTileMatrixSet()

const ossimGpkgTileMatrixSetRecord & ossimGpkgTileEntry::getTileMatrixSet ( ) const
Returns
tile matrix set.

Definition at line 87 of file ossimGpkgTileEntry.cpp.

References m_tileMatrixSet.

Referenced by ossim_gpkg::getTileEntries(), and ossim_gpkg::getTileEntry().

88 {
89  return m_tileMatrixSet;
90 }
ossimGpkgTileMatrixSetRecord m_tileMatrixSet

◆ getZoomLevelMatrixSizes()

void ossimGpkgTileEntry::getZoomLevelMatrixSizes ( std::vector< ossimIpt > &  zoomLevelMatrixSizes) const

Gets zoom level matrix of all tile matrixes.

Parameters
zoomLevelMatrixSizesIntitialized by this.

Definition at line 327 of file ossimGpkgTileEntry.cpp.

References m_tileMatrix.

329 {
330  zoomLevelMatrixSizes.clear();
331  std::vector<ossimGpkgTileMatrixRecord>::const_iterator i = m_tileMatrix.begin();
332  while ( i != m_tileMatrix.end() )
333  {
334  zoomLevelMatrixSizes.push_back( ossimIpt((*i).m_matrix_width, (*i).m_matrix_height) );
335  ++i;
336  }
337 }
std::vector< ossimGpkgTileMatrixRecord > m_tileMatrix

◆ getZoomLevels()

void ossimGpkgTileEntry::getZoomLevels ( std::vector< ossim_int32 > &  zoomLevels) const

Gets zoom levels of all tile matrixes.

Parameters
zoomLevelsIntitialized by this.

Definition at line 316 of file ossimGpkgTileEntry.cpp.

References m_tileMatrix.

317 {
318  zoomLevels.clear();
319  std::vector<ossimGpkgTileMatrixRecord>::const_iterator i = m_tileMatrix.begin();
320  while ( i != m_tileMatrix.end() )
321  {
322  zoomLevels.push_back( (*i).m_zoom_level );
323  ++i;
324  }
325 }
std::vector< ossimGpkgTileMatrixRecord > m_tileMatrix

◆ operator=()

const ossimGpkgTileEntry & ossimGpkgTileEntry::operator= ( const ossimGpkgTileEntry obj)

Definition at line 66 of file ossimGpkgTileEntry.cpp.

References m_srs, m_tileMatrix, m_tileMatrixExtents, and m_tileMatrixSet.

67 {
68  if ( this != &obj )
69  {
70  m_srs = obj.m_srs;
74  }
75  return *this;
76 }
std::vector< ossimGpkgNsgTileMatrixExtentRecord > m_tileMatrixExtents
ossimGpkgTileMatrixSetRecord m_tileMatrixSet
ossimGpkgSpatialRefSysRecord m_srs
std::vector< ossimGpkgTileMatrixRecord > m_tileMatrix

◆ print()

std::ostream & ossimGpkgTileEntry::print ( std::ostream &  out) const

Print method.

Parameters
outStream to print to.
Returns
Stream reference.

Definition at line 151 of file ossimGpkgTileEntry.cpp.

References saveState().

Referenced by operator<<().

152 {
153  ossimKeywordlist kwl;
154  saveState(kwl, std::string(""));
155  out << kwl;
156  return out;
157 }
Represents serializable keyword/value map.
void saveState(ossimKeywordlist &kwl, const std::string &prefix) const
Saves the state of object.

◆ printValidate()

std::ostream & ossimGpkgTileEntry::printValidate ( std::ostream &  out) const

Validate method.

Prints data from database and computed values.

Parameters
outStream to print to.
Returns
Stream reference.

Definition at line 159 of file ossimGpkgTileEntry.cpp.

References ossimGpkgTileMatrixSetRecord::getHeight(), ossimGpkgTileMatrixSetRecord::getWidth(), m_tileMatrix, m_tileMatrixSet, and ossimGpkgDatabaseRecordBase::print().

160 {
161  m_tileMatrixSet.print( out );
162 
163  // Capture the original flags.
164  std::ios_base::fmtflags f = out.flags();
165 
166  // Set the new precision capturing old.
167  std::streamsize oldPrecision = out.precision(15);
168 
171 
172  out << setiosflags(ios::fixed)
173  << "gpkg_tile_matrix_set.width: " << w << "\n"
174  << "gpkg_tile_matrix_set.height: " << h << "\n";
175 
176 
177  for ( ossim_uint32 i = 0; i < (ossim_uint32)m_tileMatrix.size(); ++i )
178  {
179  ossim_float64 computedX =
180  w / m_tileMatrix[i].m_matrix_width / m_tileMatrix[i].m_tile_width;
181  ossim_float64 computedY =
182  h / m_tileMatrix[i].m_matrix_height / m_tileMatrix[i].m_tile_height;
183 
184  cout << "gpkg_tile_matrix[" << i << "].zoom_level: "
185  << m_tileMatrix[i].m_zoom_level
186  << "\ngpkg_tile_matrix[" << i << "].pixel_x_size: "
187  << m_tileMatrix[i].m_pixel_x_size
188  << "\ngpkg_tile_matrix[" << i << "].pixel_x_size_computed: "
189  << computedX
190  << "\ngpkg_tile_matrix[" << i << "].pixel_x_size_delta: "
191  << m_tileMatrix[i].m_pixel_x_size - computedX
192  << "\ngpkg_tile_matrix[" << i << "].pixel_y_size: "
193  << m_tileMatrix[i].m_pixel_y_size
194  << "\ngpkg_tile_matrix[" << i << "].pixel_y_size_computed: "
195  << computedY
196  << "\ngpkg_tile_matrix[" << i << "].pixel_y_size_delta: "
197  << m_tileMatrix[i].m_pixel_y_size - computedY
198  << "\n";
199  }
200 
201  // Reset flags and precision.
202  out.setf(f);
203  out.precision(oldPrecision);
204 
205  return out;
206 }
double ossim_float64
unsigned int ossim_uint32
ossimGpkgTileMatrixSetRecord m_tileMatrixSet
virtual std::ostream & print(std::ostream &out) const
Print method.
std::vector< ossimGpkgTileMatrixRecord > m_tileMatrix

◆ saveState()

void ossimGpkgTileEntry::saveState ( ossimKeywordlist kwl,
const std::string &  prefix 
) const

Saves the state of object.

Parameters
kwlInitialized by this.
prefixe.g. "image0.". Can be empty.

Definition at line 135 of file ossimGpkgTileEntry.cpp.

References m_srs, m_tileMatrix, m_tileMatrixSet, ossimGpkgTileMatrixSetRecord::saveState(), ossimGpkgSpatialRefSysRecord::saveState(), ossimString::string(), and ossimString::toString().

Referenced by print().

137 {
138  m_srs.saveState( kwl, prefix );
139  m_tileMatrixSet.saveState( kwl, prefix );
140  std::string myPrefix = prefix;
141  myPrefix += "gpkg_tile_matrix";
142  for ( ossim_uint32 i = 0; i < (ossim_uint32)m_tileMatrix.size(); ++i )
143  {
144  std::string p = myPrefix;
145  p += ossimString::toString(i).string();
146  p += ".";
147  m_tileMatrix[i].saveState( kwl, p );
148  }
149 }
static ossimString toString(bool aValue)
Numeric to string methods.
virtual void saveState(ossimKeywordlist &kwl, const std::string &prefix) const
Saves the state of object.
unsigned int ossim_uint32
ossimGpkgTileMatrixSetRecord m_tileMatrixSet
virtual void saveState(ossimKeywordlist &kwl, const std::string &prefix) const
Saves the state of object.
ossimGpkgSpatialRefSysRecord m_srs
std::vector< ossimGpkgTileMatrixRecord > m_tileMatrix
const std::string & string() const
Definition: ossimString.h:414

◆ setSrs()

void ossimGpkgTileEntry::setSrs ( const ossimGpkgSpatialRefSysRecord srs)

Sets the spatial ref sys.

Parameters
srs

Definition at line 92 of file ossimGpkgTileEntry.cpp.

References m_srs.

Referenced by ossim_gpkg::getTileEntries(), and ossim_gpkg::getTileEntry().

93 {
94  m_srs = srs;
95 }
ossimGpkgSpatialRefSysRecord m_srs

◆ setTileMatrixSet()

void ossimGpkgTileEntry::setTileMatrixSet ( const ossimGpkgTileMatrixSetRecord set)

Sets the tile matrix set.

Parameters
set

Definition at line 82 of file ossimGpkgTileEntry.cpp.

References m_tileMatrixSet.

Referenced by ossim_gpkg::getTileEntries(), and ossim_gpkg::getTileEntry().

83 {
84  m_tileMatrixSet = set;
85 }
ossimGpkgTileMatrixSetRecord m_tileMatrixSet

◆ sortTileMatrix()

void ossimGpkgTileEntry::sortTileMatrix ( )

Sorts the m_tileMatrix by zoom levels with the highest zoom level being at the lowest array index.

The highest zoom level is the best resolution in ossim. In other words if zoom level 21 is highest zoom level this is equal to r0 (reduced resolution 0.

Definition at line 123 of file ossimGpkgTileEntry.cpp.

References m_tileMatrix.

Referenced by ossim_gpkg::getTileEntries(), and ossim_gpkg::getTileEntry().

124 {
125  std::sort(m_tileMatrix.begin(), m_tileMatrix.end(), tileMatrixSort);
126 }
std::vector< ossimGpkgTileMatrixRecord > m_tileMatrix

◆ sortTileMatrixExtents()

void ossimGpkgTileEntry::sortTileMatrixExtents ( )

Sorts the m_tileMatrixExtents by zoom levels with the highest zoom level being at the lowest array index.

The highest zoom level is the best resolution in ossim. In other words if zoom level 21 is highest zoom level this is equal to r0 (reduced resolution 0.

Definition at line 128 of file ossimGpkgTileEntry.cpp.

References m_tileMatrixExtents.

Referenced by ossim_gpkg::getTileEntries(), and ossim_gpkg::getTileEntry().

129 {
130  std::sort(m_tileMatrixExtents.begin(),
131  m_tileMatrixExtents.end(),
132  tileMatrixExtentSort);
133 }
std::vector< ossimGpkgNsgTileMatrixExtentRecord > m_tileMatrixExtents

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const ossimGpkgTileEntry obj 
)
friend

Convenience operator << function.

Parameters
outStream to print to.
objObject to print.

Definition at line 208 of file ossimGpkgTileEntry.cpp.

210 {
211  return obj.print( out );
212 }
std::ostream & print(std::ostream &out) const
Print method.

Member Data Documentation

◆ m_srs

ossimGpkgSpatialRefSysRecord ossimGpkgTileEntry::m_srs
private

Definition at line 176 of file ossimGpkgTileEntry.h.

Referenced by getNewMapProjection(), getSrs(), operator=(), saveState(), and setSrs().

◆ m_tileMatrix

std::vector<ossimGpkgTileMatrixRecord> ossimGpkgTileEntry::m_tileMatrix
private

◆ m_tileMatrixExtents

std::vector<ossimGpkgNsgTileMatrixExtentRecord> ossimGpkgTileEntry::m_tileMatrixExtents
private

◆ m_tileMatrixSet

ossimGpkgTileMatrixSetRecord ossimGpkgTileEntry::m_tileMatrixSet
private

The documentation for this class was generated from the following files: