source: qesdi/wms_ddc_vis/trunk/lib/wms_ddc_vis/templates/wms_capabilities_json.txt @ 5483

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/qesdi/wms_ddc_vis/trunk/lib/wms_ddc_vis/templates/wms_capabilities_json.txt@5483
Revision 5483, 1.2 KB checked in by pnorton, 11 years ago (diff)

Modified the GetCapabilities? response so that the styles are added to the data summary and picked up by the genshi template.

Line 
1{# Converted WMS-capabilities 1.3.0 XML to JSON #}
2{
3{% for ds in c.capabilities.contents.datasetSummaries %}
4  "${ds.identifier}": {
5    "title": "${ds.titles[0]}",
6    {% if len(ds.abstracts)>0 %}
7    "abstract": "${ds.abstracts[0]}",
8    {% end %}
9    "crss": [${','.join([`x` for x in ds.CRSs])}],
10    {% with exBBox = ds.wgs84BoundingBoxes[0] %}
11    "exbbox": [${exBBox.lowerCorner[0]}, ${exBBox.lowerCorner[1]}, ${exBBox.upperCorner[0]}, ${exBBox.upperCorner[1]}],
12    {% end %}
13    "bboxes": {
14    {% for bb in ds.boundingBoxes %}
15      "${bb.crs}": [${'%.2f'%bb.lowerCorner[0]}, ${'%.2f'%bb.lowerCorner[1]}, ${'%.2f'%bb.upperCorner[0]}, ${'%.2f'%bb.upperCorner[1]}]{% if bb!=ds.boundingBoxes[-1]%},{% end %}
16    {% end %}
17    },
18    "dimensions": {
19    {% with d_ns = ds.dimensions.keys() %}
20    {% for d_n in d_ns %}
21      "${d_n}": {
22        "units": "${ds.dimensions[d_n].valuesUnit}",
23        "unitSymbol": "${ds.dimensions[d_n].unitSymbol}",
24        "default": "${ds.dimensions[d_n].defaultValue}",
25        "extent": [${','.join([`x` for x in ds.dimensions[d_n].possibleValues.allowedValues])}]
26      }{% if d_n!=d_ns[-1] %},{% end %}
27    {% end %}
28    {% end %}
29    }
30  }{% if ds != c.capabilities.contents.datasetSummaries[-1] %},{% end %}
31  {% end %}
32}
Note: See TracBrowser for help on using the repository browser.