UNPKG

soda-angular

Version:
18 lines (17 loc) 573 B
import { WellKnownType } from '../../../../datatypes/well-known-type'; export class WithinPolygon { constructor(column, multiPolygon) { if (!column) { throw new Error("Column must be provided"); } if (!multiPolygon) { throw new Error("MultiPolygon must be provided"); } this.Column = column; this.MultiPolygon = multiPolygon; } toString() { const wkt = new WellKnownType(this.MultiPolygon.Value); return `within_polygon(${this.Column}, '${wkt}')`; } }