source: TI02-CSML/trunk/parser/API/CSMLDocument.py @ 1086

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI02-CSML/trunk/parser/API/CSMLDocument.py@1086
Revision 1086, 1.0 KB checked in by domlowe, 14 years ago (diff)

time and calendar working in netcdf output. Time subsetting by min/max or explicit values. Ready for attempt at data extractor integration.

Line 
1''' CSMLDocument.py - simple implementation to return a CSML document containing a single type of feature'''
2from API import *
3
4class CSMLDocument:
5    def makeGridSeries(self,domain,rangeSet,datasetID=None,featureID=None):
6        fms=[] #empty featureMembers list
7        feat=Parser.GridSeriesFeature()
8        if featureID:
9            feat.id= featureID
10        else:
11            feat.id='testfeature'
12        feat.description=Parser.Description('???')
13        feat.domain=domain
14        feat.rangeSet=rangeSet
15        fms.append(feat)
16        fc=Parser.FeatureCollection(members=fms)
17        #Create an Empty Dataset
18        ds = Parser.Dataset()
19        #Set objects as attributes of dataset
20        if datasetID:
21            ds.id=datasetID
22        else:
23            ds.id='testdataset'
24        ds.featureCollection=fc
25        #call the toXML method of the Dataset object:
26        csml = ds.toXML()
27        strCSML=parser_extra.PrettyPrint(csml)
28        strCSML=parser_extra.removeInlineNS(strCSML)
29        return strCSML
Note: See TracBrowser for help on using the repository browser.