source: TI02-CSML/trunk/csml/API/csmlbbox.py @ 3267

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

Documenting CSML code - not complete

RevLine 
[3267]1''' Contains implementation of a CSML bounding box with methods for getting the times, CRS and bounding points'''
[2863]2class CSMLBoundingBox(object):
[3267]3    """ Class to represent an EnvelopeWithTimePeriod Bounding Box """
[2863]4    def __init__(self, envelope):
5        self.envelope=envelope
6        self.minX=eval(self.envelope.lowerCorner.CONTENT.split()[0])
7        self.minY=eval(self.envelope.lowerCorner.CONTENT.split()[1])
8        self.maxX=eval(self.envelope.upperCorner.CONTENT.split()[0])
9        self.maxY=eval(self.envelope.upperCorner.CONTENT.split()[1])
10   
11    def getCRSName(self):
[3267]12        '''
13        Get the name of the coordinate reference system for this bounding box
14        @return:    string containing name of crs
15        '''
[2863]16        return self.envelope.srsName     
17     
18    def getBox(self):
[3267]19        '''
20        Get the bounding box values
21        @return:    a list of the form [minX, minY, maxX, maxY]
22        '''
[2890]23        return [self.minX, self.minY, self.maxX, self.maxY]
[2863]24   
[2890]25    def getTimeLimits(self):
[3267]26        '''
27        Get the start and end times of the bounding box
28        @return:    a list of strings: ['starttime', 'endtime']
29        '''
[2890]30        return [self.envelope.beginPosition.CONTENT,self.envelope.endPosition.CONTENT]
[2863]31       
Note: See TracBrowser for help on using the repository browser.