VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtCDBTile.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2016 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
10 
11 
12 #include <string>
13 #include <osgEarth/TileSource>
17 
18 namespace makVrv { namespace oe { namespace CDB
19 {
20  using namespace osgEarth;
21 
22  #define OSG_CDB_LOD_OFFSET 9 // New OSG-CDB LOD mapping
23  //#define OSG_CDB_LOD_OFFSET 7 // Previous OSG-CDB LOD mapping
24 
25  // IMPORTANT NOTES : here are the match between OSG LOD and CDB LOD
26  //
27  // OSG LOD resolution per pixel CDB LOD resolution per pixel between -50 to 50
28  // 0 0.7031250000 -9 0.5000000000
29  // 1 0.3515625000 -8 0.2500000000
30  // 2 0.1757812500 -7 0.1250000000
31  // 3 0.0878906250 -6 0.0625000000
32  // 4 0.0439453125 -5 0.0312500000
33  // 5 0.0219726563 -4 0.0156250000
34  // 6 0.0109863281 -3 0.0078125000
35  // 7 0.0054931641 -2 0.0039062500
36  // 8 0.0027465820 -1 0.0019531250
37  // 9 0.0013732910 0 0.0009765625
38  // 10 0.0006866455 1 0.0004882813
39  // 11 0.0003433228 2 0.0002441406
40  // 12 0.0001716614 3 0.0001220703
41  // 13 0.0000858307 4 0.0000610352
42  // 14 0.0000429153 5 0.0000305176
43  // 15 0.0000214577 6 0.0000152588
44  // 16 0.0000107288 7 0.0000076294
45  // 17 0.0000053644 8 0.0000038147
46  // 18 0.0000026822 9 0.0000019073
47  // etc ...
48 
52  {
53  public:
54 
56  CDBTile(std::string& CdbRootDir);
57 
59  virtual ~CDBTile();
60 
63  inline bool getLatLon(unsigned int wsg84_lod, double coord_x, double coord_y,
64  std::string& lat_str, std::string& lon_str, int& cdb_lod, int& DLonZone, std::string& path_lod_str, CDBTileCache* TileCachePtr);
65 
68  bool getPathComponents(unsigned int wgs84_lod, double x_coord, double y_coord,
69  std::string& lat_str, std::string& lon_str, std::string& lod_str, std::string& path_lod_str,
70  std::string& uref_str, std::string& rref_str, CDBTileCache* TileCachePtr);
71 
73  int calcDLonZone(double coord_y);
74 
77  int getNumTilesFoundOnDisk(const std::vector<TileKey>& intersectingKeys,
78  int CdbDatasetCode, int CdbComponentSelector1, int CdbComponentSelector2, int lod, CDBTileCache* TileCachePtr);
79 
84  bool getTileName(unsigned int wgs84_lod, double x_coord, double y_coord,
85  int CdbDatasetCode, int CdbComponentSelector1, int CdbComponentSelector2,
86  std::string& tile_name, CDBTileCache* TileCachePtr, bool exitIfGeocellDoesNotExist = false);
87 
89  inline std::string getTileFullPath(const std::string& lat_str, const std::string& lon_str,
90  int CdbDatasetCode, int CdbComponentSelector1, int CdbComponentSelector2,
91  const std::string& lod_string, const std::string& uref_string, const std::string& rref_string, bool secondaryExt=false) const;
92 
94  inline std::string getTileFolder(const std::string& lat_string, const std::string& lon_string,
95  const std::string& uref_string, const std::string& lod_string, int CdbDatasetCode) const;
96 
98  inline std::string getTileFilename(const std::string& lat_str, const std::string& lon_str,
99  int CdbDatasetCode, int CdbComponentSelector1, int CdbComponentSelector2,
100  const std::string& lod_string, const std::string& uref_string, const std::string& rref_string,
101  const std::string& FACC, const std::string& FSC, const std::string& modelName) const;
102 
104  inline std::string getTileFilename(const std::string& lat_str, const std::string& lon_str,
105  int CdbDatasetCode, int CdbComponentSelector1, int CdbComponentSelector2,
106  const std::string& lod_string, const std::string& uref_string, const std::string& rref_string, bool secondaryExt = false) const;
107 
109  inline std::string getLodString(int lod) const;
110 
111  private:
112 
114  std::string myCdbRootDir;
115 
118 
119  };
120 
121 } } } // namespace mak::osgEarth::CDB

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)