mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-03 12:02:53 +00:00
feat: add geo filter envelope support
This commit is contained in:
@@ -13,7 +13,7 @@
|
|||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
// tslint:disable-next-line:no-implicit-dependencies
|
// tslint:disable-next-line:no-implicit-dependencies
|
||||||
import {Polygon} from 'geojson';
|
import {Polygon, Position} from 'geojson';
|
||||||
import {SCThingsField} from '../../../meta';
|
import {SCThingsField} from '../../../meta';
|
||||||
import {SCSearchAbstractFilter, SCSearchAbstractFilterArguments} from '../filter';
|
import {SCSearchAbstractFilter, SCSearchAbstractFilterArguments} from '../filter';
|
||||||
|
|
||||||
@@ -29,6 +29,24 @@ export interface SCGeoFilter extends SCSearchAbstractFilter<SCGeoFilterArguments
|
|||||||
type: 'geo';
|
type: 'geo';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A rectangular geo shape, representing the top-left and bottom-right corners
|
||||||
|
*
|
||||||
|
* This is an extension of the Geojson type
|
||||||
|
* http://geojson.org/geojson-spec.html
|
||||||
|
*/
|
||||||
|
export interface Envelope {
|
||||||
|
/**
|
||||||
|
* The top-left and bottom-right corners of the bounding box
|
||||||
|
*/
|
||||||
|
coordinates: [Position, Position];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type of the geometry
|
||||||
|
*/
|
||||||
|
type: 'envelope';
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Arguments for filter instruction by geo data
|
* Arguments for filter instruction by geo data
|
||||||
*/
|
*/
|
||||||
@@ -41,7 +59,7 @@ export interface SCGeoFilterArguments extends SCSearchAbstractFilterArguments {
|
|||||||
/**
|
/**
|
||||||
* Geo data to check up on
|
* Geo data to check up on
|
||||||
*/
|
*/
|
||||||
shape: Polygon;
|
shape: Polygon | Envelope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Spatial relation between the provided shape and the shape of the field.
|
* Spatial relation between the provided shape and the shape of the field.
|
||||||
|
|||||||
Reference in New Issue
Block a user