@seasketch/geoprocessing
Version:
Geoprocessing and reporting framework for SeaSketch 2.0
149 lines • 3.32 kB
JavaScript
import { genSampleSketch, genSampleSketchCollection, genSampleSketchCollectionFromSketches, } from "../../helpers/index.js";
/**
* Zero polygon geometry sketch. Generated by functions like clipToGeography in place of creating a null geometry
*/
const zero = genSampleSketch({
type: "Polygon",
coordinates: [
[
[],
[],
[],
],
],
});
const outer = genSampleSketch({
type: "Polygon",
coordinates: [
[
[],
[],
[],
[],
[],
],
],
});
const bottomLeftPoly = genSampleSketch({
type: "Polygon",
coordinates: [
[
[],
[],
[],
[],
[],
],
],
});
const topRightPoly = genSampleSketch({
type: "Polygon",
coordinates: [
[
[],
[],
[],
[],
[],
],
],
});
const twoPolyInsideFC = {
type: "FeatureCollection",
features: [bottomLeftPoly, topRightPoly],
};
const twoPolyInsideSC = genSampleSketchCollection(twoPolyInsideFC);
const wholePoly = genSampleSketch({
type: "Polygon",
coordinates: [
[
[],
[],
[],
[],
[],
],
],
});
const wholeMultipoly = genSampleSketch({
type: "MultiPolygon",
coordinates: [
[
[
[],
[],
[],
[],
[],
],
],
],
});
const wholeMixedFC = {
type: "FeatureCollection",
features: [wholePoly, wholeMultipoly],
};
const wholeMixedSC = genSampleSketchCollection(wholeMixedFC);
// hole in bottom left
const holeBlPoly = genSampleSketch({
type: "Polygon",
coordinates: [
[
[],
[],
[],
[],
[],
],
[
[],
[],
[],
[],
[],
],
],
}, "holeBotLeft");
// hole in top right
const holeTrMultipoly = genSampleSketch({
type: "MultiPolygon",
coordinates: [
[
[
[],
[],
[],
[],
[],
],
[
[],
[],
[],
[],
[],
],
],
],
}, "holeTopRight");
/**
* Sketch collection with a whole polygon with a hole in the bottom left and a whole multipolygon with a hole in the top-right
* These two features have 100% overlap except for their holes which don't overlap at all.
*/
const holeMixedSC = genSampleSketchCollectionFromSketches([holeBlPoly, holeTrMultipoly], "holeSC");
export default {
zero,
outer,
bottomLeftPoly,
topRightPoly,
twoPolyInsideFC,
twoPolyInsideSC,
wholePoly,
wholeMultipoly,
wholeMixedFC,
wholeMixedSC,
holeBlPoly,
holeTrMultipoly,
holeMixedSC,
};
//# sourceMappingURL=sketches.js.map