[mapserver-commits] r12415 - in trunk/mapserver/mapcache: . include
src
svn at osgeo.org
svn at osgeo.org
Fri Aug 26 07:23:49 EDT 2011
Author: tbonfort
Date: 2011-08-26 04:23:49 -0700 (Fri, 26 Aug 2011)
New Revision: 12415
Modified:
trunk/mapserver/mapcache/geocache.xml
trunk/mapserver/mapcache/include/geocache.h
trunk/mapserver/mapcache/src/configuration.c
trunk/mapserver/mapcache/src/tileset.c
Log:
move sqlite db creation to a post-config step which is run by an unpriviledged user
thomas.bonfort | 2011-08-02 13:27:32 +0200 (Tue, 02 Aug 2011)
Modified: trunk/mapserver/mapcache/geocache.xml
===================================================================
--- trunk/mapserver/mapcache/geocache.xml 2011-08-26 11:23:43 UTC (rev 12414)
+++ trunk/mapserver/mapcache/geocache.xml 2011-08-26 11:23:49 UTC (rev 12415)
@@ -468,7 +468,7 @@
<params>
<FORMAT>image/png</FORMAT>
<LAYERS>default</LAYERS>
- <MAP>/gro1/mapserver-utils/osm.map</MAP>
+ <MAP>/Users/tbonfort/dev/mapserver-utils/osm.map</MAP>
</params>
</getmap>
</source>
@@ -751,5 +751,13 @@
<!-- do not enable this yet, dragons ahead !!
<pathinfo_hack/>
-->
+
+ <!-- resample mode
+ filter applied when resampling tiles for full wms requests.
+ can be either:
+ - nearest : fastest, poor quality
+ - bilinear: slower, higher qulity
+ -->
+ <resample_mode>bilinear</resample_mode>
</geocache>
Modified: trunk/mapserver/mapcache/include/geocache.h
===================================================================
--- trunk/mapserver/mapcache/include/geocache.h 2011-08-26 11:23:43 UTC (rev 12414)
+++ trunk/mapserver/mapcache/include/geocache.h 2011-08-26 11:23:49 UTC (rev 12415)
@@ -766,6 +766,11 @@
GEOCACHE_GETMAP_FORWARD
} geocache_getmap_strategy;
+typedef enum {
+ GEOCACHE_RESAMPLE_NEAREST,
+ GEOCACHE_RESAMPLE_BILINEAR
+} geocache_resample_mode;
+
/**
* a configuration that will be served
*/
@@ -820,6 +825,8 @@
geocache_getmap_strategy getmap_strategy;
+ geocache_resample_mode resample_mode;
+
apr_table_t *metadata;
const char *lockdir;
Modified: trunk/mapserver/mapcache/src/configuration.c
===================================================================
--- trunk/mapserver/mapcache/src/configuration.c 2011-08-26 11:23:43 UTC (rev 12414)
+++ trunk/mapserver/mapcache/src/configuration.c 2011-08-26 11:23:49 UTC (rev 12415)
@@ -1091,6 +1091,18 @@
goto cleanup;
}
}
+
+ config->resample_mode = GEOCACHE_RESAMPLE_BILINEAR;
+ if ((node = ezxml_child(doc,"resample_mode")) != NULL) {
+ if(!strcmp(node->txt,"nearest")) {
+ config->resample_mode = GEOCACHE_RESAMPLE_NEAREST;
+ } else if(!strcmp(node->txt,"bilinear")) {
+ config->resample_mode = GEOCACHE_RESAMPLE_BILINEAR;
+ } else {
+ ctx->set_error(ctx,400, "unknown value %s for node <resample_mode> (allowed values: nearest, bilinear", node->txt);
+ goto cleanup;
+ }
+ }
if((node = ezxml_child(doc,"lock_dir")) != NULL) {
config->lockdir = apr_pstrdup(ctx->pool, node->txt);
Modified: trunk/mapserver/mapcache/src/tileset.c
===================================================================
--- trunk/mapserver/mapcache/src/tileset.c 2011-08-26 11:23:43 UTC (rev 12414)
+++ trunk/mapserver/mapcache/src/tileset.c 2011-08-26 11:23:49 UTC (rev 12415)
@@ -154,7 +154,14 @@
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);
+ switch(ctx->config->resample_mode) {
+ case GEOCACHE_RESAMPLE_BILINEAR:
+ cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_BILINEAR);
+ break;
+ default:
+ cairo_pattern_set_filter (cairo_get_source (cr), CAIRO_FILTER_NEAREST);
+ break;
+ }
cairo_paint (cr);
cairo_surface_destroy(srcsurface);
cairo_surface_destroy(dstsurface);
More information about the mapserver-commits
mailing list