#ifndef GOOGLE_TILE_H #define GOOGLE_TILE_H #include #include #include using std::vector; using std::string; struct TileIndex { int x; int y; int z; }; struct TileBox { double north; double south; double east; double west; }; struct TileInfo { TileIndex ind; std::string tileName; std::string href;//相对路径 TileBox box; }; const int TILE_SIZE = 256; class googleTile { public: googleTile(); ~googleTile(); public: // 输出kml png void ExportGeoPng(cv::Mat _pan, TileInfo info, std::string dir); // 输出tile void ExportTile(cv::Mat _pan, TileInfo info, std::string dir); // 计算给定分辨率最接近的瓦片等级,mp单位 米/像素 int getZoomLevel(float mp); private: TileIndex LatLonToTile(double latitude, double longitude, int zoomLevel); // 瓦片编号对应的信息 TileBox GetTileBox(TileIndex ind); void WriteKml(vector tiles,string filePath); int zoom_; }; #endif // GOOGLE_TILE_H