VAPOR3 3.9.4
GeoImageTMS.h
Go to the documentation of this file.
1
2#ifndef _GeoImageTMS_h_
3#define _GeoImageTMS_h_
4
5#ifdef WIN32
6 #include <geotiff/xtiffio.h>
7 #include <geotiff/geotiff.h>
8#else
9 #include <xtiffio.h>
10 #include <geotiff.h>
11#endif
12#include <sstream>
13#include <fstream>
14#include <sys/stat.h>
15#include <vapor/MyBase.h>
16#include <vapor/UDUnitsClass.h>
17#include "GeoTileMercator.h"
18#include "GeoImage.h"
19
20namespace VAPoR {
21
26//
28public:
30 virtual ~GeoImageTMS();
31
32 int Initialize(string path, vector<double> times);
33
34 void SetLOD(int lod);
35
36 unsigned char *GetImage(size_t ts, size_t &width, size_t &height);
37
38 unsigned char *GetImage(size_t ts, const double pcsExtentsReq[4], string proj4StringReq, size_t maxWidthReq, size_t maxHeightReq, double pcsExtentsImg[4], double geoCornersImg[8],
39 string &proj4StringImg, size_t &width, size_t &height);
40
41private:
42 string _dir; // path to TMS directory
43 int _maxLOD; // Maximum LOD available in TMS
44 int _currentLOD; // Current LOD in TMS
45
46 unsigned char *_texture; // storage for texture image
47 size_t _textureSize;
48
49 unsigned char *_tileBuf; // storage for a single tile
50 size_t _tileBufSize;
51
52 GeoTileMercator *_geotile;
53
54 string _defaultProj4String; // proj4 string for global mercator
55
56 int _tileSize(string dir, size_t tileX, size_t tileY, int lod, size_t &w, size_t &h);
57
58 int _tileRead(string dir, size_t tileX, size_t tileY, int lod, unsigned char *tile);
59
60 int _getBestLOD(const double myGeoExtentsData[4], int maxWidthReq, int maxHeightReq) const;
61
62 int _getMap(const size_t pixelSW[2], const size_t pixelNE[2], int lod, unsigned char *texture);
63};
64
65}; // namespace VAPoR
66#endif
A class for managing OSGeo Tile Map Service Specification images.
Definition: GeoImageTMS.h:27
virtual ~GeoImageTMS()
void SetLOD(int lod)
unsigned char * GetImage(size_t ts, size_t &width, size_t &height)
unsigned char * GetImage(size_t ts, const double pcsExtentsReq[4], string proj4StringReq, size_t maxWidthReq, size_t maxHeightReq, double pcsExtentsImg[4], double geoCornersImg[8], string &proj4StringImg, size_t &width, size_t &height)
int Initialize(string path, vector< double > times)
An abstract class for managing geo-referenced images.
Definition: GeoImage.h:20
#define RENDER_API
Definition: common.h:78