[mapserver-commits] r12480 - in trunk/mapserver/mapcache: . include
src static
svn at osgeo.org
svn at osgeo.org
Fri Aug 26 07:30:25 EDT 2011
Author: tbonfort
Date: 2011-08-26 04:30:24 -0700 (Fri, 26 Aug 2011)
New Revision: 12480
Added:
trunk/mapserver/mapcache/static/geocache.json
Removed:
trunk/mapserver/mapcache/geocache.json
Modified:
trunk/mapserver/mapcache/geocache.xml
trunk/mapserver/mapcache/include/geocache.h
trunk/mapserver/mapcache/src/cJSON.c
trunk/mapserver/mapcache/src/cache_disk.c
trunk/mapserver/mapcache/src/cache_memcache.c
trunk/mapserver/mapcache/src/cache_sqlite.c
trunk/mapserver/mapcache/src/configuration.c
trunk/mapserver/mapcache/src/configuration_json.c
trunk/mapserver/mapcache/src/dimension.c
trunk/mapserver/mapcache/src/http.c
trunk/mapserver/mapcache/src/service_wms.c
trunk/mapserver/mapcache/src/source_wms.c
Log:
Deleted: trunk/mapserver/mapcache/geocache.json
===================================================================
--- trunk/mapserver/mapcache/geocache.json 2011-08-26 11:30:15 UTC (rev 12479)
+++ trunk/mapserver/mapcache/geocache.json 2011-08-26 11:30:24 UTC (rev 12480)
@@ -1,246 +0,0 @@
-{
- "grids": [
- {
- "name":"grid1",
- "extent":[0,3,4,4],
- "resolutions":[0,2],
- "size":[256,256],
- "metadata": {
- "title":"foo grid title",
- "fail":"sdffd"
- },
- "units":"m",
- "srs":"EPSG:4325",
- "srsaliases":["EPSG:2345","foo"]
- }
- ],
- "caches": [
- {
- "name":"disk",
- "type":"disk",
- "props": {
- "base_dir":"/tmp",
- "symlink_blank":true
- }
- },
- {
- "name":"tmpl",
- "type":"disk",
- "props": {
- "template":"/tmp/templ-test/{tileset}-{grid}-{dim}/{z}/{y}/{x}.{ext}"
- }
- },
- /*
- {
- "name":"memcache",
- "type":"memcache",
- "props": {
- "servers": [
- {
- "host":"localhost",
- "port":11211
- }
- ]
- }
- },*/
- {
- "name":"sqlite",
- "type":"sqlite3",
- "props": {
- "dbname_template":"/tmp/{tileset}-{grid}.sqlite",
- "hit_stats":false
- }
- },
- {
- "name":"mbtiles",
- "type":"mbtiles",
- "props": {
- "dbname_template":"/tmp/{tileset}-{grid}.mbtiles",
- "hit_stats":false
- }
- }
- ],
- "sources": [
- {
- "name":"vmap0",
- "type":"wms",
- "props": {
- "http": {
- "url":"http://vmap0.tiles.osgeo.org/wms/vmap0",
- "headers": {
- "User-Agent":"mod-geocache/trunk",
- "Referer":"http://foosite"
- }
- },
- "getmap": {
- "params":{
- "LAYERS":"basic",
- "FORMAT":"image/png"
- }
- },
- "getfeatureinfo": {
- "params":{
- "QUERY_LAYERS":"basic"
- },
- "info_formats":["text/html"]
- }
- }
- },
- {
- "name":"osm",
- "type":"wms",
- "props": {
- "http": {
- "url":"http://localhost/cgi-bin/mapserv"
- },
- "getmap": {
- "params":{
- "LAYERS":"default",
- "FORMAT":"image/png",
- "MAP":"/Users/tbonfort/dev/mapserver-utils/osm-outlined,google.map"
- }
- }
- }
- }
- ],
- "formats": [
- {
- "name":"jpg",
- "type":"jpg",
- "props": {
- "quality":85
- }
- },
- {
- "name":"png",
- "type":"png",
- "props": {
- "colors":256,
- "compression":"best"
- }
- },
- {
- "name":"mixed",
- "type":"mixed",
- "props": {
- "opaque":"jpg",
- "transparent":"png"
- }
- }
- ],
- "tilesets": [
- {
- "name": "test",
- "source": "vmap0",
- "grids": [
- "WGS84",
- { "ref":"g", "extent":[10,10,20,20]}
- ],
- "wgs84_extent":[-180,-90,180,90],
- "format": "png",
- "cache": "disk",
- "metatile": {
- "size":[5,5],
- "buffer":10
- },
- "expires": {
- "delay": 3600,
- "auto": false
- },
- "dimensions": [
- {
- "type":"values",
- "name":"dim1",
- "default":"val1",
- "props": {
- "values": [ "val1","val2","val3" ]
- }
- }
- ]
- //,"watermark":"/home/tbonfort/dev/mod-geocache/static/watermark.png"
- },
- {
- "name": "osm",
- "source": "osm",
- "grids": [
- "g"
- ],
- "wgs84_extent":[-180,-90,180,90],
- "format": "png",
- "cache": "mbtiles",
- "metatile": {
- "size":[5,5],
- "buffer":10
- },
- "expires": {
- "delay": 3600,
- "auto": false
- }
- },
- {
- "name": "ne",
- "source": "osm",
- "grids": [
- "g"
- ],
- "wgs84_extent":[-180,-90,180,90],
- "format": "png",
- "cache": "mbtiles",
- "metatile": {
- "size":[5,5],
- "buffer":10
- },
- "expires": {
- "delay": 3600,
- "auto": false
- }
- }
- ],
- "services": [
- { "type":"demo",
- "enabled":true
- },
- { "type":"kml",
- "enabled":false
- },
- { "type":"wmts",
- "enabled":true
- },
- {
- "type":"wms",
- "enabled":true,
- "props": {
- "forwarding_rules": [
- {
- "name":"foo rule",
- "append_pathinfo":true,
- "http": {
- "url":"http://localhost/forwarded-by-mod-geocache/"
- },
- "params": [
- {
- "name":"SERVICE",
- "type":"values",
- "props": { "values":["WMS","WFS","SOS"] }
- }
- ]
- }
- ],
- "full_getmap": {
- "strategy":"assemble",
- "resample_mode":"bilinear",
- "format":"PNG8"
- }
- }
- }
- ],
- "config": {
- "error_reporting":"message",
- "lock_dir":"/tmp",
- "default_format":"PNG8"
- }
-}
-
-/* vim: ai ts=2 sts=2 et sw=2 syntax=javascript
-*/
-
Modified: trunk/mapserver/mapcache/geocache.xml
===================================================================
--- trunk/mapserver/mapcache/geocache.xml 2011-08-26 11:30:15 UTC (rev 12479)
+++ trunk/mapserver/mapcache/geocache.xml 2011-08-26 11:30:24 UTC (rev 12480)
@@ -512,7 +512,7 @@
<params>
<FORMAT>image/png</FORMAT>
<LAYERS>default</LAYERS>
- <MAP>/Users/tbonfort/dev/mapserver-utils/osm.map</MAP>
+ <MAP>/gro1/mapserver-utils/osm.map</MAP>
</params>
</getmap>
</source>
@@ -602,8 +602,8 @@
the supplied image is read when the configuration is loaded.
if you make changes to the image, they will NOT be reflected on tiles already
stored in the cache, nor on newly stored tiles until the server is restarted
+ -->
<watermark>/home/tbonfort/dev/mod-geocache/static/watermark.png</watermark>
- -->
<!-- format
(optional) format to use when storing a tile. this should be a format with high
Modified: trunk/mapserver/mapcache/include/geocache.h
===================================================================
--- trunk/mapserver/mapcache/include/geocache.h 2011-08-26 11:30:15 UTC (rev 12479)
+++ trunk/mapserver/mapcache/include/geocache.h 2011-08-26 11:30:24 UTC (rev 12480)
@@ -27,7 +27,11 @@
#include <apr_global_mutex.h>
#include "util.h"
#include "ezxml.h"
+
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
#include "cJSON.h"
+#endif
+
#include "errors.h"
#if 0
@@ -271,12 +275,16 @@
void (*query_info)(geocache_context *ctx, geocache_feature_info *fi);
void (*configuration_parse_xml)(geocache_context *ctx, ezxml_t xml, geocache_source * source);
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
void (*configuration_parse_json)(geocache_context *ctx, cJSON *node, geocache_source * source);
+#endif
void (*configuration_check)(geocache_context *ctx, geocache_source * source);
};
geocache_http* geocache_http_configuration_parse_xml(geocache_context *ctx,ezxml_t node);
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
geocache_http* geocache_http_configuration_parse_json(geocache_context *ctx,cJSON *node);
+#endif
geocache_http* geocache_http_clone(geocache_context *ctx, geocache_http *orig);
struct geocache_http {
@@ -360,7 +368,9 @@
void (*tile_set)(geocache_context *ctx, geocache_tile * tile);
void (*configuration_parse_xml)(geocache_context *ctx, ezxml_t xml, geocache_cache * cache);
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
void (*configuration_parse_json)(geocache_context *ctx, cJSON *node, geocache_cache * cache);
+#endif
void (*configuration_post_config)(geocache_context *ctx, geocache_cache * cache, geocache_cfg *config);
};
@@ -619,7 +629,9 @@
* parse advanced configuration options for the selected service
*/
void (*configuration_parse_xml)(geocache_context *ctx, ezxml_t xml, geocache_service * service, geocache_cfg *config);
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
void (*configuration_parse_json)(geocache_context *ctx, cJSON *node, geocache_service * service, geocache_cfg *config);
+#endif
};
/**\class geocache_service_wms
@@ -907,8 +919,10 @@
*/
void geocache_configuration_parse(geocache_context *ctx, const char *filename, geocache_cfg *config);
void geocache_configuration_post_config(geocache_context *ctx, geocache_cfg *config);
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
void geocache_configuration_parse_json(geocache_context *ctx, const char *filename, geocache_cfg *config);
void parse_keyvalues(geocache_context *ctx, cJSON *node, apr_table_t *tbl);
+#endif
void geocache_configuration_parse_xml(geocache_context *ctx, const char *filename, geocache_cfg *config);
geocache_cfg* geocache_configuration_create(apr_pool_t *pool);
geocache_source* geocache_configuration_get_source(geocache_cfg *config, const char *key);
@@ -1467,7 +1481,9 @@
* \brief parse the value given in the configuration
*/
void (*configuration_parse_xml)(geocache_context *context, geocache_dimension *dim, ezxml_t node);
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
void (*configuration_parse_json)(geocache_context *context, geocache_dimension *dim, cJSON *node);
+#endif
};
struct geocache_dimension_values {
Modified: trunk/mapserver/mapcache/src/cJSON.c
===================================================================
--- trunk/mapserver/mapcache/src/cJSON.c 2011-08-26 11:30:15 UTC (rev 12479)
+++ trunk/mapserver/mapcache/src/cJSON.c 2011-08-26 11:30:24 UTC (rev 12480)
@@ -20,6 +20,8 @@
THE SOFTWARE.
*/
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
+
/* cJSON */
/* JSON parser in C. */
@@ -517,3 +519,5 @@
cJSON *cJSON_CreateFloatArray(float *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && i<count;i++){n=cJSON_CreateNumber(numbers[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}
cJSON *cJSON_CreateDoubleArray(double *numbers,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && i<count;i++){n=cJSON_CreateNumber(numbers[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}
cJSON *cJSON_CreateStringArray(const char **strings,int count) {int i;cJSON *n=0,*p=0,*a=cJSON_CreateArray();for(i=0;a && i<count;i++){n=cJSON_CreateString(strings[i]);if(!i)a->child=n;else suffix_object(p,n);p=n;}return a;}
+
+#endif
Modified: trunk/mapserver/mapcache/src/cache_disk.c
===================================================================
--- trunk/mapserver/mapcache/src/cache_disk.c 2011-08-26 11:30:15 UTC (rev 12479)
+++ trunk/mapserver/mapcache/src/cache_disk.c 2011-08-26 11:30:24 UTC (rev 12480)
@@ -415,6 +415,7 @@
/**
* \private \memberof geocache_cache_disk
*/
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
static void _geocache_cache_disk_configuration_parse_json(geocache_context *ctx, cJSON *node, geocache_cache *cache) {
cJSON *tmp;
geocache_cache_disk *dcache = (geocache_cache_disk*)cache;
@@ -445,6 +446,7 @@
}
}
}
+#endif
/**
* \private \memberof geocache_cache_disk
@@ -478,7 +480,9 @@
cache->cache.tile_set = _geocache_cache_disk_set;
cache->cache.configuration_post_config = _geocache_cache_disk_configuration_post_config;
cache->cache.configuration_parse_xml = _geocache_cache_disk_configuration_parse_xml;
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
cache->cache.configuration_parse_json = _geocache_cache_disk_configuration_parse_json;
+#endif
return (geocache_cache*)cache;
}
Modified: trunk/mapserver/mapcache/src/cache_memcache.c
===================================================================
--- trunk/mapserver/mapcache/src/cache_memcache.c 2011-08-26 11:30:15 UTC (rev 12479)
+++ trunk/mapserver/mapcache/src/cache_memcache.c 2011-08-26 11:30:24 UTC (rev 12480)
@@ -165,6 +165,7 @@
/**
* \private \memberof geocache_cache_memcache
*/
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
static void _geocache_cache_memcache_configuration_parse_json(geocache_context *ctx, cJSON *node, geocache_cache *cache) {
geocache_cache_memcache *dcache = (geocache_cache_memcache*)cache;
cJSON *servers = cJSON_GetObjectItem(node,"servers");
@@ -205,10 +206,9 @@
return;
}
}
+}
+#endif
-
-
-}
/**
* \private \memberof geocache_cache_memcache
*/
@@ -296,7 +296,9 @@
cache->cache.tile_delete = _geocache_cache_memcache_delete;
cache->cache.configuration_post_config = _geocache_cache_memcache_configuration_post_config;
cache->cache.configuration_parse_xml = _geocache_cache_memcache_configuration_parse_xml;
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
cache->cache.configuration_parse_json = _geocache_cache_memcache_configuration_parse_json;
+#endif
return (geocache_cache*)cache;
}
Modified: trunk/mapserver/mapcache/src/cache_sqlite.c
===================================================================
--- trunk/mapserver/mapcache/src/cache_sqlite.c 2011-08-26 11:30:15 UTC (rev 12479)
+++ trunk/mapserver/mapcache/src/cache_sqlite.c 2011-08-26 11:30:24 UTC (rev 12480)
@@ -232,6 +232,7 @@
sqlite3_close(handle);
}
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
static void _geocache_cache_sqlite_configuration_parse_json(geocache_context *ctx, cJSON *node, geocache_cache *cache) {
cJSON *tmp;
geocache_cache_sqlite *dcache = (geocache_cache_sqlite*)cache;
@@ -273,6 +274,7 @@
dcache->hitstat_stmt.sql = apr_pstrdup(ctx->pool,tmp->valuestring);
}
}
+#endif
static void _geocache_cache_sqlite_configuration_parse_xml(geocache_context *ctx, ezxml_t node, geocache_cache *cache) {
ezxml_t cur_node;
@@ -344,7 +346,9 @@
cache->cache.tile_set = _geocache_cache_sqlite_set;
cache->cache.configuration_post_config = _geocache_cache_sqlite_configuration_post_config;
cache->cache.configuration_parse_xml = _geocache_cache_sqlite_configuration_parse_xml;
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
cache->cache.configuration_parse_json = _geocache_cache_sqlite_configuration_parse_json;
+#endif
cache->create_stmt.sql = apr_pstrdup(ctx->pool,
"create table if not exists tiles(x integer, y integer, z integer, data blob, dim text, ctime datetime, atime datetime, hitcount integer default 0, primary key(x,y,z,dim))");
cache->exists_stmt.sql = apr_pstrdup(ctx->pool,
Modified: trunk/mapserver/mapcache/src/configuration.c
===================================================================
--- trunk/mapserver/mapcache/src/configuration.c 2011-08-26 11:30:15 UTC (rev 12479)
+++ trunk/mapserver/mapcache/src/configuration.c 2011-08-26 11:30:24 UTC (rev 12480)
@@ -22,11 +22,15 @@
void geocache_configuration_parse(geocache_context *ctx, const char *filename, geocache_cfg *config) {
int len = strlen(filename);
const char *ext = &(filename[len-3]);
- if(strcasecmp(ext,"xml")) {
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
+ if(!strcasecmp(ext,"xml")) {
+#endif
+ geocache_configuration_parse_xml(ctx,filename,config);
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
+ } else {
geocache_configuration_parse_json(ctx,filename,config);
- } else {
- geocache_configuration_parse_xml(ctx,filename,config);
}
+#endif
GC_CHECK_ERROR(ctx);
if(!config->lockdir || !strlen(config->lockdir)) {
Modified: trunk/mapserver/mapcache/src/configuration_json.c
===================================================================
--- trunk/mapserver/mapcache/src/configuration_json.c 2011-08-26 11:30:15 UTC (rev 12479)
+++ trunk/mapserver/mapcache/src/configuration_json.c 2011-08-26 11:30:24 UTC (rev 12480)
@@ -1,3 +1,5 @@
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
+
#include "geocache.h"
#include <errno.h>
#include <apr_strings.h>
@@ -828,3 +830,5 @@
fclose(f);
//free(filedata);
}
+
+#endif
Modified: trunk/mapserver/mapcache/src/dimension.c
===================================================================
--- trunk/mapserver/mapcache/src/dimension.c 2011-08-26 11:30:15 UTC (rev 12479)
+++ trunk/mapserver/mapcache/src/dimension.c 2011-08-26 11:30:24 UTC (rev 12480)
@@ -54,9 +54,11 @@
return ret;
}
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
static void _geocache_dimension_intervals_parse_json(geocache_context *ctx, geocache_dimension *dim,
cJSON *node) {
}
+#endif
static void _geocache_dimension_intervals_parse_xml(geocache_context *ctx, geocache_dimension *dim,
ezxml_t node) {
@@ -127,6 +129,7 @@
return ret;
}
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
static void _geocache_dimension_regex_parse_json(geocache_context *ctx, geocache_dimension *dim,
cJSON *node) {
geocache_dimension_regex *dimension = (geocache_dimension_regex*)dim;
@@ -158,6 +161,7 @@
return;
}
}
+#endif
static void _geocache_dimension_regex_parse_xml(geocache_context *ctx, geocache_dimension *dim,
ezxml_t node) {
@@ -216,6 +220,7 @@
return ret;
}
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
static void _geocache_dimension_values_parse_json(geocache_context *ctx, geocache_dimension *dim,
cJSON *node) {
cJSON *tmp;
@@ -243,6 +248,7 @@
return;
}
}
+#endif
static void _geocache_dimension_values_parse_xml(geocache_context *ctx, geocache_dimension *dim,
ezxml_t node) {
@@ -282,7 +288,9 @@
dimension->nvalues = 0;
dimension->dimension.validate = _geocache_dimension_values_validate;
dimension->dimension.configuration_parse_xml = _geocache_dimension_values_parse_xml;
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
dimension->dimension.configuration_parse_json = _geocache_dimension_values_parse_json;
+#endif
dimension->dimension.print_ogc_formatted_values = _geocache_dimension_values_print;
return (geocache_dimension*)dimension;
}
@@ -303,7 +311,9 @@
dimension->nintervals = 0;
dimension->dimension.validate = _geocache_dimension_intervals_validate;
dimension->dimension.configuration_parse_xml = _geocache_dimension_intervals_parse_xml;
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
dimension->dimension.configuration_parse_json = _geocache_dimension_intervals_parse_json;
+#endif
dimension->dimension.print_ogc_formatted_values = _geocache_dimension_intervals_print;
return (geocache_dimension*)dimension;
}
@@ -315,7 +325,9 @@
#endif
dimension->dimension.validate = _geocache_dimension_regex_validate;
dimension->dimension.configuration_parse_xml = _geocache_dimension_regex_parse_xml;
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
dimension->dimension.configuration_parse_json = _geocache_dimension_regex_parse_json;
+#endif
dimension->dimension.print_ogc_formatted_values = _geocache_dimension_regex_print;
return (geocache_dimension*)dimension;
}
Modified: trunk/mapserver/mapcache/src/http.c
===================================================================
--- trunk/mapserver/mapcache/src/http.c 2011-08-26 11:30:15 UTC (rev 12479)
+++ trunk/mapserver/mapcache/src/http.c 2011-08-26 11:30:24 UTC (rev 12480)
@@ -300,6 +300,7 @@
/* TODO: parse <proxy> and <auth> elements */
}
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
geocache_http* geocache_http_configuration_parse_json(geocache_context *ctx, cJSON *node) {
cJSON *tmp;
geocache_http *req = (geocache_http*)apr_pcalloc(ctx->pool,sizeof(geocache_http));
@@ -326,6 +327,7 @@
return req;
/* TODO: parse <proxy> and <auth> elements */
}
+#endif
geocache_http* geocache_http_clone(geocache_context *ctx, geocache_http *orig) {
Modified: trunk/mapserver/mapcache/src/service_wms.c
===================================================================
--- trunk/mapserver/mapcache/src/service_wms.c 2011-08-26 11:30:15 UTC (rev 12479)
+++ trunk/mapserver/mapcache/src/service_wms.c 2011-08-26 11:30:24 UTC (rev 12480)
@@ -774,6 +774,7 @@
#endif
}
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
void _configuration_parse_wms_json(geocache_context *ctx, cJSON *node, geocache_service *gservice, geocache_cfg *cfg) {
assert(gservice->type == GEOCACHE_SERVICE_WMS);
geocache_service_wms *wms = (geocache_service_wms*)gservice;
@@ -888,6 +889,7 @@
}
}
}
+#endif
void _configuration_parse_wms_xml(geocache_context *ctx, ezxml_t node, geocache_service *gservice, geocache_cfg *cfg) {
assert(gservice->type == GEOCACHE_SERVICE_WMS);
@@ -985,7 +987,9 @@
service->service.parse_request = _geocache_service_wms_parse_request;
service->service.create_capabilities_response = _create_capabilities_wms;
service->service.configuration_parse_xml = _configuration_parse_wms_xml;
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
service->service.configuration_parse_json = _configuration_parse_wms_json;
+#endif
service->getmap_strategy = GEOCACHE_GETMAP_ASSEMBLE;
service->resample_mode = GEOCACHE_RESAMPLE_BILINEAR;
return (geocache_service*)service;
Modified: trunk/mapserver/mapcache/src/source_wms.c
===================================================================
--- trunk/mapserver/mapcache/src/source_wms.c 2011-08-26 11:30:15 UTC (rev 12479)
+++ trunk/mapserver/mapcache/src/source_wms.c 2011-08-26 11:30:24 UTC (rev 12480)
@@ -91,6 +91,7 @@
* \private \memberof geocache_source_wms
* \sa geocache_source::configuration_parse()
*/
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
void _geocache_source_wms_configuration_parse_json(geocache_context *ctx, cJSON *props, geocache_source *source) {
cJSON *tmp;
geocache_source_wms *src = (geocache_source_wms*)source;
@@ -130,10 +131,8 @@
tmp = cJSON_GetObjectItem(tmp,"params");
parse_keyvalues(ctx,tmp,src->getfeatureinfo_params);
}
-
-
-
}
+#endif
/**
* \private \memberof geocache_source_wms
* \sa geocache_source::configuration_parse()
@@ -216,7 +215,9 @@
source->source.render_map = _geocache_source_wms_render_map;
source->source.configuration_check = _geocache_source_wms_configuration_check;
source->source.configuration_parse_xml = _geocache_source_wms_configuration_parse_xml;
+#ifdef ENABLE_UNMAINTAINED_JSON_PARSER
source->source.configuration_parse_json = _geocache_source_wms_configuration_parse_json;
+#endif
source->source.query_info = _geocache_source_wms_query;
source->wms_default_params = apr_table_make(ctx->pool,4);;
source->getmap_params = apr_table_make(ctx->pool,4);
Added: trunk/mapserver/mapcache/static/geocache.json
===================================================================
--- trunk/mapserver/mapcache/static/geocache.json (rev 0)
+++ trunk/mapserver/mapcache/static/geocache.json 2011-08-26 11:30:24 UTC (rev 12480)
@@ -0,0 +1,246 @@
+{
+ "grids": [
+ {
+ "name":"grid1",
+ "extent":[0,3,4,4],
+ "resolutions":[0,2],
+ "size":[256,256],
+ "metadata": {
+ "title":"foo grid title",
+ "fail":"sdffd"
+ },
+ "units":"m",
+ "srs":"EPSG:4325",
+ "srsaliases":["EPSG:2345","foo"]
+ }
+ ],
+ "caches": [
+ {
+ "name":"disk",
+ "type":"disk",
+ "props": {
+ "base_dir":"/tmp",
+ "symlink_blank":true
+ }
+ },
+ {
+ "name":"tmpl",
+ "type":"disk",
+ "props": {
+ "template":"/tmp/templ-test/{tileset}-{grid}-{dim}/{z}/{y}/{x}.{ext}"
+ }
+ },
+ /*
+ {
+ "name":"memcache",
+ "type":"memcache",
+ "props": {
+ "servers": [
+ {
+ "host":"localhost",
+ "port":11211
+ }
+ ]
+ }
+ },*/
+ {
+ "name":"sqlite",
+ "type":"sqlite3",
+ "props": {
+ "dbname_template":"/tmp/{tileset}-{grid}.sqlite",
+ "hit_stats":false
+ }
+ },
+ {
+ "name":"mbtiles",
+ "type":"mbtiles",
+ "props": {
+ "dbname_template":"/tmp/{tileset}-{grid}.mbtiles",
+ "hit_stats":false
+ }
+ }
+ ],
+ "sources": [
+ {
+ "name":"vmap0",
+ "type":"wms",
+ "props": {
+ "http": {
+ "url":"http://vmap0.tiles.osgeo.org/wms/vmap0",
+ "headers": {
+ "User-Agent":"mod-geocache/trunk",
+ "Referer":"http://foosite"
+ }
+ },
+ "getmap": {
+ "params":{
+ "LAYERS":"basic",
+ "FORMAT":"image/png"
+ }
+ },
+ "getfeatureinfo": {
+ "params":{
+ "QUERY_LAYERS":"basic"
+ },
+ "info_formats":["text/html"]
+ }
+ }
+ },
+ {
+ "name":"osm",
+ "type":"wms",
+ "props": {
+ "http": {
+ "url":"http://localhost/cgi-bin/mapserv"
+ },
+ "getmap": {
+ "params":{
+ "LAYERS":"default",
+ "FORMAT":"image/png",
+ "MAP":"/Users/tbonfort/dev/mapserver-utils/osm-outlined,google.map"
+ }
+ }
+ }
+ }
+ ],
+ "formats": [
+ {
+ "name":"jpg",
+ "type":"jpg",
+ "props": {
+ "quality":85
+ }
+ },
+ {
+ "name":"png",
+ "type":"png",
+ "props": {
+ "colors":256,
+ "compression":"best"
+ }
+ },
+ {
+ "name":"mixed",
+ "type":"mixed",
+ "props": {
+ "opaque":"jpg",
+ "transparent":"png"
+ }
+ }
+ ],
+ "tilesets": [
+ {
+ "name": "test",
+ "source": "vmap0",
+ "grids": [
+ "WGS84",
+ { "ref":"g", "extent":[10,10,20,20]}
+ ],
+ "wgs84_extent":[-180,-90,180,90],
+ "format": "png",
+ "cache": "disk",
+ "metatile": {
+ "size":[5,5],
+ "buffer":10
+ },
+ "expires": {
+ "delay": 3600,
+ "auto": false
+ },
+ "dimensions": [
+ {
+ "type":"values",
+ "name":"dim1",
+ "default":"val1",
+ "props": {
+ "values": [ "val1","val2","val3" ]
+ }
+ }
+ ]
+ //,"watermark":"/home/tbonfort/dev/mod-geocache/static/watermark.png"
+ },
+ {
+ "name": "osm",
+ "source": "osm",
+ "grids": [
+ "g"
+ ],
+ "wgs84_extent":[-180,-90,180,90],
+ "format": "png",
+ "cache": "mbtiles",
+ "metatile": {
+ "size":[5,5],
+ "buffer":10
+ },
+ "expires": {
+ "delay": 3600,
+ "auto": false
+ }
+ },
+ {
+ "name": "ne",
+ "source": "osm",
+ "grids": [
+ "g"
+ ],
+ "wgs84_extent":[-180,-90,180,90],
+ "format": "png",
+ "cache": "mbtiles",
+ "metatile": {
+ "size":[5,5],
+ "buffer":10
+ },
+ "expires": {
+ "delay": 3600,
+ "auto": false
+ }
+ }
+ ],
+ "services": [
+ { "type":"demo",
+ "enabled":true
+ },
+ { "type":"kml",
+ "enabled":false
+ },
+ { "type":"wmts",
+ "enabled":true
+ },
+ {
+ "type":"wms",
+ "enabled":true,
+ "props": {
+ "forwarding_rules": [
+ {
+ "name":"foo rule",
+ "append_pathinfo":true,
+ "http": {
+ "url":"http://localhost/forwarded-by-mod-geocache/"
+ },
+ "params": [
+ {
+ "name":"SERVICE",
+ "type":"values",
+ "props": { "values":["WMS","WFS","SOS"] }
+ }
+ ]
+ }
+ ],
+ "full_getmap": {
+ "strategy":"assemble",
+ "resample_mode":"bilinear",
+ "format":"PNG8"
+ }
+ }
+ }
+ ],
+ "config": {
+ "error_reporting":"message",
+ "lock_dir":"/tmp",
+ "default_format":"PNG8"
+ }
+}
+
+/* vim: ai ts=2 sts=2 et sw=2 syntax=javascript
+*/
+
More information about the mapserver-commits
mailing list