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

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

subsetting to point series working

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 createPointSeriesFeature(self,value=None, parameter=None, location=None, featureID=None,description=None):
37        feature=csml.parser.PointSeriesFeature()
38        feature=self._createAbstractFeature(feature, value, parameter,featureID,description)
39        feature.location =location
40        return feature
41
42    def createGridSeriesFeature(self,value, parameter=None,featureID=None,description=None):
43        feature=csml.parser.GridSeriesFeature()
44        feature= self._createAbstractFeature(feature, value, parameter,featureID,description)
45        return feature
46   
47    #def setBoundingEnvelope(self,lowerCorner,upperCorner,timePosition1,timePosition2):
48        ##set the bounding box envelope of the feature collection.
49        ## put this in container?
50        #etp = csml.parser.EnvelopeWithTimePeriod()
51        #etp.lowerCorner=lowerCorner
52        #etp.upperCorner=upperCorner
53        #etp.timePosition=timePosition1
54        #etp.timePosition2=timePosition2
55        #self.fc.boundedBy=etp
Note: See TracBrowser for help on using the repository browser.