|
...
|
...
|
@@ -76,7 +76,7 @@ namespace DmpWmts |
|
76
|
76
|
dmpTileLayer->getTileMatrixSets(tileMatrixSets);
|
|
77
|
77
|
double resolution;
|
|
78
|
78
|
DmpPoint origin;
|
|
79
|
|
- int iLevel,xMinTile,yMinTile, xMaxTile, yMaxTile,buffLen;
|
|
|
79
|
+ int iLevel,xMinTile,yMinTile, xMaxTile, yMaxTile;
|
|
80
|
80
|
if(!TileProviderFactory::GetTileScale(dmpTileLayer,iLevel,xMinTile,yMinTile, xMaxTile, yMaxTile))
|
|
81
|
81
|
{
|
|
82
|
82
|
response.sendError(500, "缩略图范围错误:(");
|
|
...
|
...
|
@@ -90,9 +90,12 @@ namespace DmpWmts |
|
90
|
90
|
{
|
|
91
|
91
|
for(int j=0;j<=heigth;j++)
|
|
92
|
92
|
{
|
|
93
|
|
- std::string strBuff;
|
|
94
|
|
- GetTile(yMaxTile+j,xMinTile+i,iLevel,strBuff,buffLen);
|
|
95
|
|
-
|
|
|
93
|
+ std::string filepath;
|
|
|
94
|
+ if(GetTile(yMaxTile+j,xMinTile+i,iLevel,format,filepath))
|
|
|
95
|
+ {
|
|
|
96
|
+ cairo_surface_t* image = cairo_image_surface_create_from_png( filepath.c_str());
|
|
|
97
|
+ TileProviderFactory::BufferCopy(image,surface,cr,i*256,j*256);
|
|
|
98
|
+ }
|
|
96
|
99
|
//TileProviderFactory::BufferCopy(image,surface,cr,i*256,j*256);
|
|
97
|
100
|
//cairo_surface_write_to_png (surface, "./wmts.png");
|
|
98
|
101
|
}
|
|
...
|
...
|
@@ -107,8 +110,19 @@ namespace DmpWmts |
|
107
|
110
|
cairo_destroy (cr);
|
|
108
|
111
|
cairo_surface_destroy (surface);
|
|
109
|
112
|
}
|
|
110
|
|
- bool DmpEsriTileProvider::GetTile(int row, int col, int level,std::string& refbuff,int& length )
|
|
|
113
|
+ bool DmpEsriTileProvider::GetTile(const int row,const int col,const int level,const std::string& format,std::string& reTilePath)
|
|
111
|
114
|
{
|
|
|
115
|
+ std::string level_str = "L" + DmpWmtsUtils::IntToFormatStr(level);
|
|
|
116
|
+ std::string row_str = "R" + IntToHex8Str(row);
|
|
|
117
|
+ std::string col_str = "C" + IntToHex8Str(col);
|
|
|
118
|
+
|
|
|
119
|
+ reTilePath = rootPath_ + level_str + "/"+ row_str+"/"+ col_str + "." + format;
|
|
112
|
120
|
|
|
|
121
|
+ std::ifstream fread(reTilePath, std::ifstream::binary);
|
|
|
122
|
+ if(!fread)
|
|
|
123
|
+ {
|
|
|
124
|
+ return false;
|
|
|
125
|
+ }
|
|
|
126
|
+
|
|
113
|
127
|
}
|
|
114
|
128
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|