[mapserver-commits] r12700 - trunk/mapserver/mapcache/src

svn at osgeo.org svn at osgeo.org
Wed Oct 26 08:39:23 EDT 2011


Author: tbonfort
Date: 2011-10-26 05:39:23 -0700 (Wed, 26 Oct 2011)
New Revision: 12700

Modified:
   trunk/mapserver/mapcache/src/grid.c
   trunk/mapserver/mapcache/src/service_wmts.c
Log:
use versioned urn for epsg.
use correct axis ordering for wmts topleftcorner
ignore missing style in gettiel requests



Modified: trunk/mapserver/mapcache/src/grid.c
===================================================================
--- trunk/mapserver/mapcache/src/grid.c	2011-10-26 10:21:27 UTC (rev 12699)
+++ trunk/mapserver/mapcache/src/grid.c	2011-10-26 12:39:23 UTC (rev 12700)
@@ -66,7 +66,7 @@
       epsgnum++;
    }
 
-   return apr_psprintf(ctx->pool,"urn:ogc:def:crs:EPSG::%s",epsgnum);
+   return apr_psprintf(ctx->pool,"urn:ogc:def:crs:EPSG:6.3:%s",epsgnum);
 }
 
 const char* mapcache_grid_get_srs(mapcache_context *ctx, mapcache_grid *grid) {

Modified: trunk/mapserver/mapcache/src/service_wmts.c
===================================================================
--- trunk/mapserver/mapcache/src/service_wmts.c	2011-10-26 10:21:27 UTC (rev 12699)
+++ trunk/mapserver/mapcache/src/service_wmts.c	2011-10-26 12:39:23 UTC (rev 12700)
@@ -224,8 +224,8 @@
             }
          }
 
-
-         /* gaia gis chokes if this is added to the capabilities doc,
+         /*
+          * gaia gis chokes if this is added to the capabilities doc,
           * so disable it for now
           *
          double *gbbox = grid_link->restricted_extent?grid_link->restricted_extent:grid_link->grid->extent;
@@ -266,7 +266,7 @@
                grid->extent[0], grid->extent[1]));
       ezxml_set_txt(ezxml_add_child(bbox,"UpperCorner",0),apr_psprintf(ctx->pool,"%f %f",
                grid->extent[2], grid->extent[3]));
-
+      ezxml_set_attr(bbox,"crs",mapcache_grid_get_crs(ctx,grid));
       
       if(WellKnownScaleSet) {
          ezxml_set_txt(ezxml_add_child(tmset,"WellKnownScaleSet",0),WellKnownScaleSet);
@@ -278,9 +278,15 @@
          ezxml_set_txt(ezxml_add_child(tm,"ows:Identifier",0),apr_psprintf(ctx->pool,"%d",level));
          double scaledenom = glevel->resolution * mapcache_meters_per_unit[grid->unit] / 0.00028;
          ezxml_set_txt(ezxml_add_child(tm,"ScaleDenominator",0),apr_psprintf(ctx->pool,"%.20f",scaledenom));
-         ezxml_set_txt(ezxml_add_child(tm,"TopLeftCorner",0),apr_psprintf(ctx->pool,"%f %f",
-                  grid->extent[0],
-                  grid->extent[1] + glevel->maxy * glevel->resolution * grid->tile_sy));
+         if(mapcache_is_axis_inverted(grid->srs)) {
+            ezxml_set_txt(ezxml_add_child(tm,"TopLeftCorner",0),apr_psprintf(ctx->pool,"%f %f",
+               grid->extent[1] + glevel->maxy * glevel->resolution * grid->tile_sy,
+               grid->extent[0]));
+         } else {
+            ezxml_set_txt(ezxml_add_child(tm,"TopLeftCorner",0),apr_psprintf(ctx->pool,"%f %f",
+                     grid->extent[0],
+                     grid->extent[1] + glevel->maxy * glevel->resolution * grid->tile_sy));
+         }
          ezxml_set_txt(ezxml_add_child(tm,"TileWidth",0),apr_psprintf(ctx->pool,"%d",grid->tile_sx));
          ezxml_set_txt(ezxml_add_child(tm,"TileHeight",0),apr_psprintf(ctx->pool,"%d",grid->tile_sy));
          ezxml_set_txt(ezxml_add_child(tm,"MatrixWidth",0),apr_psprintf(ctx->pool,"%d",glevel->maxx));
@@ -329,6 +335,7 @@
          /* extract our wnated parameters, they will be validated later on */
          tilerow = apr_table_get(params,"TILEROW");
          style = apr_table_get(params,"STYLE");
+         if(!style || !*style) style = "default";
          tilecol = apr_table_get(params,"TILECOL");
          format = apr_table_get(params,"FORMAT");
          layer = apr_table_get(params,"LAYER");
@@ -467,7 +474,8 @@
    }
       
    mapcache_grid_link *grid_link = NULL;
-   
+  
+
    if(!style || strcmp(style,"default")) {
       ctx->set_error(ctx,404, "received request with invalid style \"%s\" (expecting \"default\")",style);
       return;



More information about the mapserver-commits mailing list