[mapserver-commits] r12407 - in trunk/mapserver/mapcache: include
src
svn at osgeo.org
svn at osgeo.org
Fri Aug 26 07:23:09 EDT 2011
Author: tbonfort
Date: 2011-08-26 04:23:09 -0700 (Fri, 26 Aug 2011)
New Revision: 12407
Modified:
trunk/mapserver/mapcache/include/geocache.h
trunk/mapserver/mapcache/src/grid.c
trunk/mapserver/mapcache/src/tileset.c
Log:
support basic WMS 1.3.0 GetMap Requests
Update issue 46:
support WMS 1.3.0 requests: read grid srs from the CRS parameter
and lookup axis-order of given srs when reading the passed BBOX
thomas.bonfort | 2011-07-22 14:08:15 +0200 (Fri, 22 Jul 2011)
Modified: trunk/mapserver/mapcache/include/geocache.h
===================================================================
--- trunk/mapserver/mapcache/include/geocache.h 2011-08-26 11:23:04 UTC (rev 12406)
+++ trunk/mapserver/mapcache/include/geocache.h 2011-08-26 11:23:09 UTC (rev 12407)
@@ -1150,6 +1150,9 @@
void geocache_grid_get_xy(geocache_context *ctx, geocache_grid *grid, double dx, double dy, int z, int *x, int *y);
double geocache_grid_get_resolution(double *bbox, int sx, int sy);
+double geocache_grid_get_horizontal_resolution(double *bbox, int width);
+double geocache_grid_get_vertical_resolution(double *bbox, int height);
+
int geocache_grid_get_level(geocache_context *ctx, geocache_grid *grid, double *resolution, int *level);
void geocache_grid_compute_limits(const geocache_grid *grid, const double *extent, int **limits);
Modified: trunk/mapserver/mapcache/src/grid.c
===================================================================
--- trunk/mapserver/mapcache/src/grid.c 2011-08-26 11:23:04 UTC (rev 12406)
+++ trunk/mapserver/mapcache/src/grid.c 2011-08-26 11:23:09 UTC (rev 12407)
@@ -84,11 +84,20 @@
}
double geocache_grid_get_resolution(double *bbox, int sx, int sy) {
- double rx = (bbox[2] - bbox[0]) / (double)sx;
- double ry = (bbox[3] - bbox[1]) / (double)sy;
+ double rx = geocache_grid_get_horizontal_resolution(bbox,sx);
+ double ry = geocache_grid_get_vertical_resolution(bbox,sy);
return GEOCACHE_MAX(rx,ry);
}
+
+double geocache_grid_get_horizontal_resolution(double *bbox, int width) {
+ return (bbox[2] - bbox[0]) / (double)width;
+}
+
+double geocache_grid_get_vertical_resolution(double *bbox, int height) {
+ return (bbox[3] - bbox[1]) / (double)height;
+}
+
int geocache_grid_get_level(geocache_context *ctx, geocache_grid *grid, double *resolution, int *level) {
double max_diff = *resolution / (double)GEOCACHE_MAX(grid->tile_sx, grid->tile_sy);
int i;
Modified: trunk/mapserver/mapcache/src/tileset.c
===================================================================
--- trunk/mapserver/mapcache/src/tileset.c 2011-08-26 11:23:04 UTC (rev 12406)
+++ trunk/mapserver/mapcache/src/tileset.c 2011-08-26 11:23:09 UTC (rev 12407)
@@ -86,8 +86,8 @@
double *bbox, int width, int height,
int ntiles,
geocache_tile **tiles) {
- double hresolution = geocache_grid_get_resolution(bbox, width, width);
- double vresolution = geocache_grid_get_resolution(bbox, height, height);
+ double hresolution = geocache_grid_get_horizontal_resolution(bbox, width);
+ double vresolution = geocache_grid_get_vertical_resolution(bbox, height);
double tilebbox[4];
geocache_image *image = geocache_image_create(ctx);
image->w = width;
@@ -121,7 +121,7 @@
cairo_translate (cr, dstminx,dstminy);
cairo_scale (cr, hf, vf);
cairo_set_source_surface (cr, srcsurface, 0, 0);
- cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_NEAREST);
+ cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_BILINEAR);
cairo_paint (cr);
cairo_restore(cr);
cairo_surface_destroy(srcsurface);
More information about the mapserver-commits
mailing list