source: cows/trunk/cows/pylons/templates/wms_capabilities_json.txt @ 4078

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/cows/trunk/cows/pylons/templates/wms_capabilities_json.txt@4078
Revision 4078, 1019 bytes checked in by spascoe, 11 years ago (diff)

JSON Capabilities implemented as a 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: [{% for crs in ds.CRSs %}"${crs}",{% end %}],
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]}],
16    {% end %}
17    },
18    dimensions: {
19    {% for d_n, d in ds.dimensions.iteritems() %}
20      "${d_n}": {
21        units: "${d.valuesUnit}",
22        unitSymbol: "${d.unitSymbol}",
23        default: "${d.defaultValue}",
24        extent: [{% for v in d.possibleValues.allowedValues %}"${v}",{% end %}],
25      },
26    {% end %}
27    }
28  },
29  {% end %}
30}
Note: See TracBrowser for help on using the repository browser.