@@ -213,4 +213,132 @@ export class Query {
213213
214214 static and = ( queries : string [ ] ) =>
215215 new Query ( "and" , undefined , queries . map ( ( query ) => JSON . parse ( query ) ) ) . toString ( ) ;
216+
217+ /**
218+ * Filter resources where attribute is at a specific distance from the given coordinates.
219+ *
220+ * @param {string } attribute
221+ * @param {any[] } values
222+ * @param {number } distance
223+ * @param {boolean } meters
224+ * @returns {string }
225+ */
226+ static distanceEqual = ( attribute : string , values : any [ ] , distance : number , meters : boolean = true ) : string =>
227+ new Query ( "distanceEqual" , attribute , [ values , distance , meters ] as QueryTypesList ) . toString ( ) ;
228+
229+ /**
230+ * Filter resources where attribute is not at a specific distance from the given coordinates.
231+ *
232+ * @param {string } attribute
233+ * @param {any[] } values
234+ * @param {number } distance
235+ * @param {boolean } meters
236+ * @returns {string }
237+ */
238+ static distanceNotEqual = ( attribute : string , values : any [ ] , distance : number , meters : boolean = true ) : string =>
239+ new Query ( "distanceNotEqual" , attribute , [ values , distance , meters ] as QueryTypesList ) . toString ( ) ;
240+
241+ /**
242+ * Filter resources where attribute is at a distance greater than the specified value from the given coordinates.
243+ *
244+ * @param {string } attribute
245+ * @param {any[] } values
246+ * @param {number } distance
247+ * @param {boolean } meters
248+ * @returns {string }
249+ */
250+ static distanceGreaterThan = ( attribute : string , values : any [ ] , distance : number , meters : boolean = true ) : string =>
251+ new Query ( "distanceGreaterThan" , attribute , [ values , distance , meters ] as QueryTypesList ) . toString ( ) ;
252+
253+ /**
254+ * Filter resources where attribute is at a distance less than the specified value from the given coordinates.
255+ *
256+ * @param {string } attribute
257+ * @param {any[] } values
258+ * @param {number } distance
259+ * @param {boolean } meters
260+ * @returns {string }
261+ */
262+ static distanceLessThan = ( attribute : string , values : any [ ] , distance : number , meters : boolean = true ) : string =>
263+ new Query ( "distanceLessThan" , attribute , [ values , distance , meters ] as QueryTypesList ) . toString ( ) ;
264+
265+ /**
266+ * Filter resources where attribute intersects with the given geometry.
267+ *
268+ * @param {string } attribute
269+ * @param {any[] } values
270+ * @returns {string }
271+ */
272+ static intersects = ( attribute : string , values : any [ ] ) : string =>
273+ new Query ( "intersects" , attribute , values ) . toString ( ) ;
274+
275+ /**
276+ * Filter resources where attribute does not intersect with the given geometry.
277+ *
278+ * @param {string } attribute
279+ * @param {any[] } values
280+ * @returns {string }
281+ */
282+ static notIntersects = ( attribute : string , values : any [ ] ) : string =>
283+ new Query ( "notIntersects" , attribute , values ) . toString ( ) ;
284+
285+ /**
286+ * Filter resources where attribute crosses the given geometry.
287+ *
288+ * @param {string } attribute
289+ * @param {any[] } values
290+ * @returns {string }
291+ */
292+ static crosses = ( attribute : string , values : any [ ] ) : string =>
293+ new Query ( "crosses" , attribute , values ) . toString ( ) ;
294+
295+ /**
296+ * Filter resources where attribute does not cross the given geometry.
297+ *
298+ * @param {string } attribute
299+ * @param {any[] } values
300+ * @returns {string }
301+ */
302+ static notCrosses = ( attribute : string , values : any [ ] ) : string =>
303+ new Query ( "notCrosses" , attribute , values ) . toString ( ) ;
304+
305+ /**
306+ * Filter resources where attribute overlaps with the given geometry.
307+ *
308+ * @param {string } attribute
309+ * @param {any[] } values
310+ * @returns {string }
311+ */
312+ static overlaps = ( attribute : string , values : any [ ] ) : string =>
313+ new Query ( "overlaps" , attribute , values ) . toString ( ) ;
314+
315+ /**
316+ * Filter resources where attribute does not overlap with the given geometry.
317+ *
318+ * @param {string } attribute
319+ * @param {any[] } values
320+ * @returns {string }
321+ */
322+ static notOverlaps = ( attribute : string , values : any [ ] ) : string =>
323+ new Query ( "notOverlaps" , attribute , values ) . toString ( ) ;
324+
325+ /**
326+ * Filter resources where attribute touches the given geometry.
327+ *
328+ * @param {string } attribute
329+ * @param {any[] } values
330+ * @returns {string }
331+ */
332+ static touches = ( attribute : string , values : any [ ] ) : string =>
333+ new Query ( "touches" , attribute , values ) . toString ( ) ;
334+
335+ /**
336+ * Filter resources where attribute does not touch the given geometry.
337+ *
338+ * @param {string } attribute
339+ * @param {any[] } values
340+ * @returns {string }
341+ */
342+ static notTouches = ( attribute : string , values : any [ ] ) : string =>
343+ new Query ( "notTouches" , attribute , values ) . toString ( ) ;
216344}
0 commit comments