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

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

subsetting ProfileSeries? to Profile working more or less

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=None, parameter=None, location=None, featureID=None,description=None):
25        feature=csml.parser.ProfileSeriesFeature()
26        feature=self._createAbstractFeature(feature, value, parameter,featureID,description)
27        feature.location =location
28        return feature
29
30    def createProfileFeature(self,value=None, parameter=None, location=None, time=None, featureID=None,description=None):
31        feature=csml.parser.ProfileFeature()
32        feature=self._createAbstractFeature(feature, value, parameter,featureID,description)
33        #feature.location =location
34        return feature
35
36    def createGridSeriesFeature(self,value, parameter=None,featureID=None,description=None):
37        feature=csml.parser.GridSeriesFeature()
38        feature= self._createAbstractFeature(feature, value, parameter,featureID,description)
39        return feature
40   
41    #def setBoundingEnvelope(self,lowerCorner,upperCorner,timePosition1,timePosition2):
42        ##set the bounding box envelope of the feature collection.
43        ## put this in container?
44        #etp = csml.parser.EnvelopeWithTimePeriod()
45        #etp.lowerCorner=lowerCorner
46        #etp.upperCorner=upperCorner
47        #etp.timePosition=timePosition1
48        #etp.timePosition2=timePosition2
49        #self.fc.boundedBy=etp
Note: See TracBrowser for help on using the repository browser.