VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtCDBTile.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2025 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
10 
11 
12 #include <string>
13 #include <osgEarth/TileSource>
14 #include <osgEarth/GeoData>
20 #include <set>
21 
22 namespace makVrv { namespace oe { namespace CDB
23 {
24  using namespace osgEarth;
25 
27  // IMPORTANT NOTES : here are the match between OSG LOD and CDB LOD
28  //
29  // OSG LOD resolution per pixel CDB LOD resolution per pixel between -50 to 50
30  // 0 0.7031250000 -9 0.5000000000
31  // 1 0.3515625000 -8 0.2500000000
32  // 2 0.1757812500 -7 0.1250000000
33  // 3 0.0878906250 -6 0.0625000000
34  // 4 0.0439453125 -5 0.0312500000
35  // 5 0.0219726563 -4 0.0156250000
36  // 6 0.0109863281 -3 0.0078125000
37  // 7 0.0054931641 -2 0.0039062500
38  // 8 0.0027465820 -1 0.0019531250
39  // 9 0.0013732910 0 0.0009765625
40  // 10 0.0006866455 1 0.0004882813
41  // 11 0.0003433228 2 0.0002441406
42  // 12 0.0001716614 3 0.0001220703
43  // 13 0.0000858307 4 0.0000610352
44  // 14 0.0000429153 5 0.0000305176
45  // 15 0.0000214577 6 0.0000152588
46  // 16 0.0000107288 7 0.0000076294
47  // 17 0.0000053644 8 0.0000038147
48  // 18 0.0000026822 9 0.0000019073
49  // etc ...
50  #define OSG_CDB_LOD_OFFSET 9
51 
52 
56  {
57  public:
58 
60  CDBTile(const std::string& CdbRootDir);
61 
63  virtual ~CDBTile();
64 
67  bool getLatLon(unsigned int wsg84_lod, double coord_x, double coord_y,
68  std::string& lat_str, std::string& lon_str, int& cdb_lod, int& DLonZone, std::string& path_lod_str, CDBTileCache* TileCachePtr);
69 
72  bool getPathComponents(unsigned int wgs84_lod, double x_coord, double y_coord,
73  CDBTileVerbose& key, std::string& lod_str, std::string& path_lod_str,
74  CDBTileCache* TileCachePtr);
75 
77  static int calcDLonZone(double coord_y);
78 
81  int getNumTilesFoundOnDisk(const std::vector<TileKey>& intersectingKeys,
82  int CdbDatasetCode, int CdbComponentSelector1, int CdbComponentSelector2, int lod, CDBTileCache* TileCachePtr);
83 
88  bool getTileName(unsigned int wgs84_lod, double x_coord, double y_coord,
89  int CdbDatasetCode, int CdbComponentSelector1, int CdbComponentSelector2,
90  std::string& tile_name, CDBTileCache* TileCachePtr, bool exitIfGeocellDoesNotExist = false);
91 
93  void getTilesName(unsigned int wgs84_lod, const osgEarth::GeoExtent& tileExtent,
94  int CdbDatasetCode, int CdbComponentSelector1, int CdbComponentSelector2,
95  makVrv::oe::CDB::DtCDBUtils::CdbTileOrderedSet& cdbtiles_filename, CDBTileCache* TileCachePtr, bool onlyExistingFiles);
96 
98  std::string getTileFullPath(int lat, int lon,
99  int CdbDatasetCode, int CdbComponentSelector1, int CdbComponentSelector2,
100  int lod, int uref, int rref, bool secondaryExt = false) const;
101 
103  std::string getTileFullPath(const CDBTileVerbose& key,
104  int CdbDatasetCode, int CdbComponentSelector1, int CdbComponentSelector2,
105  int lod, bool secondaryExt = false) const;
106 
108  std::string getTileFolder(const CDBTileVerbose& key, const std::string& lod_string, int CdbDatasetCode) const;
109 
111  std::string getTileFilename(const CDBTileVerbose& key,
112  int CdbDatasetCode, int CdbComponentSelector1, int CdbComponentSelector2,
113  const std::string& lod_string,
114  const std::string& FACC, const std::string& FSC, const std::string& modelName) const;
115 
117  std::string getTileFilename(const CDBTileVerbose& key,
118  int CdbDatasetCode, int CdbComponentSelector1, int CdbComponentSelector2,
119  const std::string& lod_string, bool secondaryExt = false) const;
120 
122  std::string getLodString(int lod) const;
123 
125  std::string getLodFolderString(int lod) const;
126 
128  std::string getLatString(double lat) const;
129 
131  std::string getLatString(int lat) const;
132 
134  std::string getLonString(double lat, double lon, int& DLonZone) const;
135 
137  std::string getLonString(int lon) const;
138 
140  std::string getUrefString(int uref) const;
141 
143  std::string getRrefString(int rref) const;
144 
146  void getRrefString(double lat, double lon, int cdb_lod, std::string& uref_string, std::string& rref_string) const;
147 
149  const std::string getCdbRoot();
150 
152  CDBDatasets* findCdbDataSets();
153 
154  protected:
155  void addExistingTileIfNeeded(const CDBTileVerbose& key, const std::string& lod_string, int CdbDatasetCode, int CdbComponentSelector1, int CdbComponentSelector2,
156  const std::string& path_lod_str, bool onlyExistingFiles, bool doesGeocellExist, makVrv::oe::CDB::DtCDBUtils::CdbTileOrderedSet& cdbtiles_filename );
157 
158 
159  private:
160 
162  std::string myCdbRootDir;
163 
166 
167  };
168 
169 } } } // namespace mak::osgEarth::CDB
CDB Tile cache manager Used by CDBTileSource to try to avoid reading the the same CDB tile many time ...
Definition: DtCDBTileCache.h:34
functions class that help find CDB tiles information
#define DT_DLL_OSGEARTH_CDB_UTILS
Definition: DtCDBExport.h:18
Class the parse CDB folder before loading it to speed up the actual reading later.
Utility class to get CDB dataset information.
std::set< std::string, CdbTileFilenameComparator > CdbTileOrderedSet
Definition: DtCDBUtils.h:131
std::string myCdbRootDir
CDB root folder from the .earth file.
Definition: DtCDBTile.h:162
Class used to find CDB Tiles information.
Definition: DtCDBTile.h:55
Generic utility class.
Utility class to pass CDB lat/lon/ured/rref) values.
Definition: DtCDBTileVerbose.h:17
CDBDatasets * myCDBDatasets
CDB Dataset information manager.
Definition: DtCDBTile.h:165
CDB Dataset class. Hold Dataset information Helper class to retreive CBD Dataset information.
Definition: DtCDBDatasets.h:78

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)