Changeset 1220

Show
Ignore:
Timestamp:
10/16/08 15:37:05 (3 months ago)
Author:
fredj
Message:

backport fix for #263

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sandbox/camptocamp/MapFishUnhcr/server/python/mapfish/lib/filters/spatial.py

    r1046 r1220  
    121121            geom = func.transform(geom, epsg) 
    122122 
    123         if tolerance > 0: 
     123        if tolerance is not None and tolerance > 0: 
    124124            e = func.distance(geom, pg_point) < tolerance 
    125125        else: 
  • sandbox/camptocamp/MapFishUnhcr/server/python/mapfish/lib/protocol.py

    r1174 r1220  
    6767            epsg=epsg 
    6868        ) 
    69     elif 'lon' and 'lat' and 'tolerance' in request.params: 
     69    elif 'lon' and 'lat' in request.params: 
    7070        # within filter 
     71        tolerance = None 
     72        if 'tolerance' in request.params: 
     73            tolerance = float(request.params['tolerance']) 
    7174        filter = Spatial( 
    7275            Spatial.WITHIN, 
     
    7477            lon=float(request.params['lon']), 
    7578            lat=float(request.params['lat']), 
    76             tolerance=float(request.params['tolerance'])
     79            tolerance=tolerance
    7780            epsg=epsg 
    7881        )