def _handle_spatial_filters(self, coll, q):
        # handle geospatial queries
        if 'geo' in self.api_arguments:
            print("Geospatial limit")
            geo = json.loads(
                self.api_arguments['geo']) \
                    if isinstance(self.api_arguments['geo'], str) \
                    else self.api_arguments['geo']

            geometries = [k for k in coll.document_class.specials if coll.document_class.specials[k].is_geometry]

            if not geometries:
                raise ValidationError("Requested a geometric query on a non geometric collection")
            if 'against' not in geo:
                test_property = geometries[0]
            elif geometries not in geo['against']:
                raise KeyError('Not a valid geometry name')
            else:
                test_property = geo['against']
            op = geo['op']
            geom = r.geojson(geo['test'])
            if op not in self.GEOSPATIAL_OPS:
                raise ValidationError("Cannot perform non geometry op in geometry query")
            q = getattr(q, op)(geom, index=test_property, *geo.get('args',[]), **geo.get('kwargs', {}))
        return q
dataset/ETHPy150Open JeffHeard/sondra/sondra/api.py/APIRequest._handle_spatial_filters/swapped operands of `not in`