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

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

location attribute now working in subsetToProfileSeries

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