Skip to content

Commit 4033eaa

Browse files
authored
Merge pull request #260 from geographika/zoom-levels
Add additional zoom levels to GoogleMapsCompatible grids
2 parents 47d2757 + 912750e commit 4033eaa

File tree

3 files changed

+39
-6
lines changed

3 files changed

+39
-6
lines changed

lib/configuration.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void mapcache_configuration_parse(mapcache_context *ctx, const char *filename, m
4141

4242
GC_CHECK_ERROR(ctx);
4343

44-
/* if we were suppplied with an onlineresource, make sure it ends with a / */
44+
/* if we were supplied with an onlineresource, make sure it ends with a / */
4545
if(NULL != (url = (char*)apr_table_get(config->metadata,"url"))) {
4646
char *urlend = url + strlen(url)-1;
4747
if(*urlend != '/') {
@@ -91,7 +91,7 @@ mapcache_cfg* mapcache_configuration_create(apr_pool_t *pool)
9191
5.36441802978516e-6
9292
};
9393

94-
double google_resolutions[19] = {
94+
double google_resolutions[22] = {
9595
156543.0339280410,
9696
78271.51696402048,
9797
39135.75848201023,
@@ -110,7 +110,10 @@ mapcache_cfg* mapcache_configuration_create(apr_pool_t *pool)
110110
4.777314267823516,
111111
2.388657133911758,
112112
1.194328566955879,
113-
0.5971642834779395
113+
0.5971642834779395,
114+
0.2985821417389697,
115+
0.1492910708694849,
116+
0.0746455354347424
114117
};
115118

116119

@@ -178,7 +181,7 @@ mapcache_cfg* mapcache_configuration_create(apr_pool_t *pool)
178181
apr_table_add(grid->metadata,"profile","global-mercator");
179182
apr_table_add(grid->metadata,"wellKnownScaleSet","urn:ogc:def:wkss:OGC:1.0:GoogleMapsCompatible");
180183
grid->tile_sx = grid->tile_sy = 256;
181-
grid->nlevels = 19;
184+
grid->nlevels = 22;
182185
grid->unit = MAPCACHE_UNIT_METERS;
183186
grid->extent = google_extent;
184187
grid->levels = (mapcache_grid_level**)apr_pcalloc(pool,
@@ -203,7 +206,7 @@ mapcache_cfg* mapcache_configuration_create(apr_pool_t *pool)
203206
apr_table_add(grid->metadata,"profile","global-mercator");
204207
apr_table_add(grid->metadata,"wellKnownScaleSet","urn:ogc:def:wkss:OGC:1.0:GoogleMapsCompatible");
205208
grid->tile_sx = grid->tile_sy = 256;
206-
grid->nlevels = 19;
209+
grid->nlevels = 22;
207210
grid->unit = MAPCACHE_UNIT_METERS;
208211
grid->extent = google_extent;
209212
grid->levels = (mapcache_grid_level**)apr_pcalloc(pool,

mapcache.xml.sample

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
<srsalias>EPSG:900913</srsalias>
108108
<units>m</units>
109109
<size>256 256</size>
110-
<resolutions>156543.0339280410 78271.51696402048 39135.75848201023 19567.87924100512 9783.939620502561 4891.969810251280 2445.984905125640 1222.992452562820 611.4962262814100 305.7481131407048 152.8740565703525 76.43702828517624 38.21851414258813 19.10925707129406 9.554628535647032 4.777314267823516 2.388657133911758 1.194328566955879 0.5971642834779395</resolutions>
110+
<resolutions>156543.0339280410 78271.51696402048 39135.75848201023 19567.87924100512 9783.939620502561 4891.969810251280 2445.984905125640 1222.992452562820 611.4962262814100 305.7481131407048 152.8740565703525 76.43702828517624 38.21851414258813 19.10925707129406 9.554628535647032 4.777314267823516 2.388657133911758 1.194328566955879 0.5971642834779395 0.2985821417389697 0.1492910708694849 0.0746455354347424</resolutions>
111111
</grid>
112112
-->
113113

@@ -142,6 +142,9 @@
142142
2.388657133911758
143143
1.194328566955879
144144
0.5971642834779395
145+
0.2985821417389697
146+
0.1492910708694849
147+
0.0746455354347424
145148
</resolutions>
146149
</grid>
147150
-->

tests/expected/wmts_capabilities.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,33 @@
242242
<MatrixWidth>262144</MatrixWidth>
243243
<MatrixHeight>262144</MatrixHeight>
244244
</TileMatrix>
245+
<TileMatrix>
246+
<ows:Identifier>19</ows:Identifier>
247+
<ScaleDenominator>1066.36479192489173328795</ScaleDenominator>
248+
<TopLeftCorner>-20037508.342789 20037508.342789</TopLeftCorner>
249+
<TileWidth>256</TileWidth>
250+
<TileHeight>256</TileHeight>
251+
<MatrixWidth>524288</MatrixWidth>
252+
<MatrixHeight>524288</MatrixHeight>
253+
</TileMatrix>
254+
<TileMatrix>
255+
<ows:Identifier>20</ows:Identifier>
256+
<ScaleDenominator>533.18239596244609401765</ScaleDenominator>
257+
<TopLeftCorner>-20037508.342789 20037508.342789</TopLeftCorner>
258+
<TileWidth>256</TileWidth>
259+
<TileHeight>256</TileHeight>
260+
<MatrixWidth>1048576</MatrixWidth>
261+
<MatrixHeight>1048576</MatrixHeight>
262+
</TileMatrix>
263+
<TileMatrix>
264+
<ows:Identifier>21</ows:Identifier>
265+
<ScaleDenominator>266.59119798122287647857</ScaleDenominator>
266+
<TopLeftCorner>-20037508.342789 20037508.342789</TopLeftCorner>
267+
<TileWidth>256</TileWidth>
268+
<TileHeight>256</TileHeight>
269+
<MatrixWidth>2097152</MatrixWidth>
270+
<MatrixHeight>2097152</MatrixHeight>
271+
</TileMatrix>
245272
</TileMatrixSet>
246273
</Contents>
247274
</Capabilities>

0 commit comments

Comments
 (0)