Changeset 4354 for cows


Ignore:
Timestamp:
23/10/08 12:17:29 (11 years ago)
Author:
domlowe
Message:

Adding PropertyIsEqualTo? filter

Location:
cows/trunk/cows
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cows/trunk/cows/model/filterencoding.py

    r4352 r4354  
    7373        resultset=set(featureset.getFeaturesByBBox(bbtuple, srsname))                               
    7474        return resultset         
    75      
     75 
     76class PropertyIsEqualTo(Filter): 
     77    def evaluate(self,featureset):       
     78        propname, literal = self.elem.getchildren() 
     79        resultset=set(featureset.getFeaturesByPropertyEqualTo(propname.text, literal.text)) 
     80        return resultset 
     81         
    7682class PropertyIsBetween(Filter): 
    7783    def evaluate(self, featureset): 
    78         #TODO for time ranges 
    79         resultset=set(featureset.featuresByPropertyBetween(propertyname, lowerbound, upperbound)) 
    80          
     84        #TODO finish property between 
     85        lowerbound=upperbound=propertyname=None 
     86        resultset=set(featureset.getFeaturesByPropertyBetween(propertyname, lowerbound, upperbound)) 
     87        return resultset 
    8188                       
    8289class FEQueryProcessor(object): 
     
    105112        elif filterelem.tag ==OGC('BBOX'): 
    106113            f=BBoxFilter(filterelem) 
     114        elif filterelem.tag ==OGC('PropertyIsEqualTo'): 
     115            f=PropertyIsEqualTo(filterelem) 
    107116        log.debug('Filter tag = %s'%filterelem.tag) 
    108117        return f 
  • cows/trunk/cows/service/imps/csmlbackend/wfs_csmllayer.py

    r4352 r4354  
    114114        return [] 
    115115     
     116    def getFeaturesByPropertyEqualTo(self, propertyname, value): 
     117        log.debug('GET FEATURES BY PropertyEqualTo') 
     118        result=[] 
     119        if propertyname == 'csml:parameter': 
     120            log.debug('filtering on csml:parameter')           
     121            for featureid,feature in self.featureinstances.iteritems(): 
     122                if feature._feature.parameter.getStandardName() == value: 
     123                    result.append(feature)         
     124        return result 
    116125     
    117126class CSMLFeatureInstance(IFeatureInstance): 
Note: See TracChangeset for help on using the changeset viewer.