source: TI02-CSML/trunk/csml/csmllibs/csmlfeaturewrap.py @ 2210

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI02-CSML/trunk/csml/csmllibs/csmlfeaturewrap.py@2210
Revision 2210, 1.6 KB checked in by domlowe, 13 years ago (diff)

parameter added to subsetted feature, plus general tidying and removal of obselete csmlwrapper functions

Line 
1''' csmlfeaturewrap.py - wrapper functions for creating features'''
2
3import csml.parser
4import csml.parser_extra
5
6class CSMLWrapper(object):
7    def __init__(self):
8        pass
9           
10           
11    def _createAbstractFeature(self, feature, value, parameter=None,featureID=None,description=None):
12        if featureID:
13            feature.id= featureID
14        else:
15            feature.id='No ID'
16        if description:
17            feature.description=description
18        else:
19            feature.description='No Description'
20        feature.value=value
21        feature.parameter=parameter
22        return feature
23       
24    def createProfileSeriesFeature(self,value, parameter=None,featureID=None,description=None):
25        feature=csml.parser.ProfileSeriesFeature()
26        feature=self._createAbstractFeature(feature, value, parameter,featureID,description)
27        return feature
28
29    def createGridSeriesFeature(self,value, parameter=None,featureID=None,description=None):
30        feature=csml.parser.GridSeriesFeature()
31        feature= self._createAbstractFeature(feature, value, parameter,featureID,description)
32        return feature
33   
34    #def setBoundingEnvelope(self,lowerCorner,upperCorner,timePosition1,timePosition2):
35        ##set the bounding box envelope of the feature collection.
36        ## put this in container?
37        #etp = csml.parser.EnvelopeWithTimePeriod()
38        #etp.lowerCorner=lowerCorner
39        #etp.upperCorner=upperCorner
40        #etp.timePosition=timePosition1
41        #etp.timePosition2=timePosition2
42        #self.fc.boundedBy=etp
Note: See TracBrowser for help on using the repository browser.