soda-angular
Version:
Socrata SODA client for Angular
18 lines (17 loc) • 573 B
JavaScript
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}')`;
}
}