def spatial_query(self): error_400_msg = 'Please provide a suitable bbox parameter [minx,miny,maxx,maxy]' if not 'bbox' in request.params: abort(400,error_400_msg) bbox = validate_bbox(request.params['bbox']) if not bbox: abort(400,error_400_msg) srid = get_srid(request.params.get('crs')) if 'crs' in request.params else None extents = bbox_query(bbox,srid) format = request.params.get('format','') return self._output_results(extents,format)
def spatial_query(register): error_400_msg = \ 'Please provide a suitable bbox parameter [minx,miny,maxx,maxy]' if 'bbox' not in request.args: return _finish_bad_request(error_400_msg) bbox = validate_bbox(request.params['bbox']) if not bbox: return _finish_bad_request(error_400_msg) srid = get_srid(request.args.get('crs')) if 'crs' in \ request.args else None extents = bbox_query(bbox, srid) ids = [extent.package_id for extent in extents] output = dict(count=len(ids), results=ids) return _finish_ok(output)
def spatial_query(self): ''' ''' error_400_msg = \ u'Please provide a suitable bbox parameter [minx,miny,maxx,maxy]' if not u'bbox' in toolkit.request.params: toolkit.abort(400, error_400_msg) bbox = validate_bbox(toolkit.request.params[u'bbox']) if not bbox: toolkit.abort(400, error_400_msg) srid = get_srid(toolkit.request.params.get( u'crs')) if u'crs' in toolkit.request.params else None extents = bbox_query(bbox, srid) format = toolkit.request.params.get(u'format', u'') return self._output_results(extents, format)