Changeset 722

Show
Ignore:
Timestamp:
06/12/08 10:20:52 (5 years ago)
Author:
pgiraud
Message:

fixed wrong transform calls resulting in wrong tolerance units

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/MapFish/server/python/mapfish/plugins/search.py

    r666 r722  
    5454        epsg = self.epsg 
    5555        if 'epsg' in request.params: 
    56             epsg = request.params['epsg'] 
     56            epsg = int(request.params['epsg']) 
    5757 
    5858        # deal with lonlat query 
     
    6464            pgPoint = func.pointfromtext(point.wkt, epsg) 
    6565 
     66            geom = self.geomColumn 
     67 
    6668            if epsg != self.epsg: 
    67                 pgPoint = func.transform(pgPoint, self.epsg) 
     69                geom = func.transform(geom, epsg) 
    6870 
    6971            # build query expression 
    7072            tolerance = float(request.params['tolerance']) 
    7173            if tolerance > 0: 
    72                 e = func.distance(self.geomColumn, pgPoint) < tolerance 
     74                e = func.distance(geom, pgPoint) < tolerance 
    7375            else: 
    74                 e = func.within(pgPoint, self.geomColumn) 
     76                e = func.within(pgPoint, geom) 
    7577 
    7678            # update query expression