server/api/utils/filters

Methods

(static) bbox(query, bboxString) → {Query}

Source:

Modifies a database query so that it returns only records with a geometry that is inside the specified bounding box.

const { bbox } = require('../utils/filters');

let query = new MyModelWithGeometry();

query = bbox(query, '10,20,30,40');
Parameters:
Name Type Description
query Query

A Bookshelf database query.

bboxString string

A bounding box string (4 comma-separated numbers).

Returns:

The updated query.

Type
Query