Ignore:
Timestamp:
18/11/08 15:23:13 (12 years ago)
Author:
domlowe
Message:

Support for gridseries subsetting stored query

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cows/trunk/cows/service/imps/csmlbackend/wfs_csmllayer.py

    r4422 r4439  
    112112        qet=QueryExpressionText('csml:PointFeature') 
    113113        pex=ParameterExpression('timeinstance', 'string') 
    114         query=StoredQuery(qid, title='SelectFeaturesByPhenomenon', abstract = 'Extract a csml:PointFeature for a single time instance from a csml:PointSeriesFeature', queryExpressionText = qet, parameter=pex) 
     114        query=StoredQuery(qid, title='ExtractPointFromPointSeries', abstract = 'Extract a csml:PointFeature for a single time instance from a csml:PointSeriesFeature', queryExpressionText = qet, parameter=pex) 
    115115        self.queries[qid]=(query, CSMLQueries.query_extractPointFromPointSeries) 
     116 
     117        #query to extract a GridSeriesFeature from a GridSeriesFeature 
     118        qid='extractGridSeriesFromGridSeries' 
     119        qet=QueryExpressionText('csml:GridSeriesFeature') 
     120        pex=ParameterExpression('timerange', 'string') 
     121        query=StoredQuery(qid, title='ExtractGridSeriesFromGridSeries', abstract = 'Extract a csml:PointFeature for a single time instance from a csml:PointSeriesFeature', queryExpressionText = qet, parameter=pex) 
     122        self.queries[qid]=(query, CSMLQueries.query_extractGridSeriesFromGridSeries) 
    116123 
    117124 
     
    209216        self._feature=feature 
    210217        self.featuretype=self._feature.__class__.__name__ 
    211         bb= self._feature.getCSMLBoundingBox().getBox() 
    212         #convert 0 - 360 to -180, 180 as per common WMS convention 
    213         if abs(bb[2]-bb[0]) >= 359 and abs(bb[2]-bb[0]) < 361: 
    214             bb[0], bb[2]=-180, 180 
    215         self.wgs84BBox = bb 
    216          
     218        try: 
     219            bb= self._feature.getCSMLBoundingBox().getBox() 
     220            #convert 0 - 360 to -180, 180 as per common WMS convention 
     221            if abs(bb[2]-bb[0]) >= 359 and abs(bb[2]-bb[0]) < 361: 
     222                bb[0], bb[2]=-180, 180 
     223            self.wgs84BBox = bb 
     224        except AttributeError: 
     225            log.debug('there is a problem getting the bounding box for feature id %s'%self._feature.id) 
     226            self.wgs84BBox=() 
    217227    def toGML(self): 
    218228        """ Create a GML (CSML) representation of the feature """ 
Note: See TracChangeset for help on using the changeset viewer.