VR-Forces 5.0.3 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) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
10 
11 
12 #include <string>
13 #include <osgEarth/TileSource>
18 
19 namespace makVrv { namespace oe { namespace CDB
20 {
21  using namespace osgEarth;
22 
24  // IMPORTANT NOTES : here are the match between OSG LOD and CDB LOD
25  //
26  // OSG LOD resolution per pixel CDB LOD resolution per pixel between -50 to 50
27  // 0 0.7031250000 -9 0.5000000000
28  // 1 0.3515625000 -8 0.2500000000
29  // 2 0.1757812500 -7 0.1250000000
30  // 3 0.0878906250 -6 0.0625000000
31  // 4 0.0439453125 -5 0.0312500000
32  // 5 0.0219726563 -4 0.0156250000
33  // 6 0.0109863281 -3 0.0078125000
34  // 7 0.0054931641 -2 0.0039062500
35  // 8 0.0027465820 -1 0.0019531250
36  // 9 0.0013732910 0 0.0009765625
37  // 10 0.0006866455 1 0.0004882813
38  // 11 0.0003433228 2 0.0002441406
39  // 12 0.0001716614 3 0.0001220703
40  // 13 0.0000858307 4 0.0000610352
41  // 14 0.0000429153 5 0.0000305176
42  // 15 0.0000214577 6 0.0000152588
43  // 16 0.0000107288 7 0.0000076294
44  // 17 0.0000053644 8 0.0000038147
45  // 18 0.0000026822 9 0.0000019073
46  // etc ...
47  #define OSG_CDB_LOD_OFFSET 9
48 
49 
53  {
54  public:
55 
57  CDBTile(const std::string& CdbRootDir);
58 
60  virtual ~CDBTile();
61 
64  bool getLatLon(unsigned int wsg84_lod, double coord_x, double coord_y,
65  std::string& lat_str, std::string& lon_str, int& cdb_lod, int& DLonZone, std::string& path_lod_str, CDBTileCache* TileCachePtr);
66 
69  bool getPathComponents(unsigned int wgs84_lod, double x_coord, double y_coord,
70  CDBTileVerbose& key, std::string& lod_str, std::string& path_lod_str,
71  CDBTileCache* TileCachePtr);
72 
74  static int calcDLonZone(double coord_y);
75 
78  int getNumTilesFoundOnDisk(const std::vector<TileKey>& intersectingKeys,
79  int CdbDatasetCode, int CdbComponentSelector1, int CdbComponentSelector2, int lod, CDBTileCache* TileCachePtr);
80 
85  bool getTileName(unsigned int wgs84_lod, double x_coord, double y_coord,
86  int CdbDatasetCode, int CdbComponentSelector1, int CdbComponentSelector2,
87  std::string& tile_name, CDBTileCache* TileCachePtr, bool exitIfGeocellDoesNotExist = false);
88 
90  std::string getTileFullPath(int lat, int lon,
91  int CdbDatasetCode, int CdbComponentSelector1, int CdbComponentSelector2,
92  int lod, int uref, int rref, bool secondaryExt = false) const;
93 
95  std::string getTileFullPath(const CDBTileVerbose& key,
96  int CdbDatasetCode, int CdbComponentSelector1, int CdbComponentSelector2,
97  int lod, bool secondaryExt = false) const;
98 
100  std::string getTileFolder(const CDBTileVerbose& key, const std::string& lod_string, int CdbDatasetCode) const;
101 
103  std::string getTileFilename(const CDBTileVerbose& key,
104  int CdbDatasetCode, int CdbComponentSelector1, int CdbComponentSelector2,
105  const std::string& lod_string,
106  const std::string& FACC, const std::string& FSC, const std::string& modelName) const;
107 
109  std::string getTileFilename(const CDBTileVerbose& key,
110  int CdbDatasetCode, int CdbComponentSelector1, int CdbComponentSelector2,
111  const std::string& lod_string, bool secondaryExt = false) const;
112 
114  std::string getLodString(int lod) const;
115 
117  std::string getLodFolderString(int lod) const;
118 
120  std::string getLatString(double lat) const;
121 
123  std::string getLatString(int lat) const;
124 
126  std::string getLonString(double lat, double lon, int& DLonZone) const;
127 
129  std::string getLonString(int lon) const;
130 
132  std::string getUrefString(int uref) const;
133 
135  std::string getRrefString(int rref) const;
136 
138  void getRrefString(double lat, double lon, int cdb_lod, std::string& uref_string, std::string& rref_string) const;
139 
140 
141  private:
142 
144  std::string myCdbRootDir;
145 
148 
149  };
150 
151 } } } // 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
used to export/import dll function from this dll to another (osgdb_osgearth_cdb)
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::string myCdbRootDir
CDB root folder from the .earth file.
Definition: DtCDBTile.h:144
Class used to find CDB Tiles information.
Definition: DtCDBTile.h:52
Utility class to pass CDB lat/lon/ured/rref) values.
Definition: DtCDBTileVerbose.h:17
CDBDatasets * myCDBDatasets
CDB Dataset information manager.
Definition: DtCDBTile.h:147
CDB Dataset class. Hold Dataset information Helper class to retreive CBD Dataset information.
Definition: DtCDBDatasets.h:78

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)