From cc4b829baa372768d0e2017c83a21775a15ef954 Mon Sep 17 00:00:00 2001 From: Tim Welch Date: Wed, 11 Dec 2024 23:27:57 -0800 Subject: [PATCH] add more tests to getFeaturesForSketchBBoxes, improve squareSketches, add squares.fgb with txt file showing layout, update squares.json --- packages/geoprocessing/data/in/squares.fgb | Bin 0 -> 2328 bytes packages/geoprocessing/data/in/squares.json | 101 ++++++------- .../geoprocessing/data/in/squaresReadme.txt | 54 +++++++ .../getFeaturesForSketchBBoxes.test.e2e.ts | 119 ++++++++++++---- .../src/testing/fixtures/squareSketches.ts | 133 +++++++++++++----- .../geoprocessing/src/toolbox/area.test.ts | 6 +- .../src/toolbox/genPreprocessor.test.ts | 12 +- .../src/toolbox/overlapArea.test.ts | 64 ++++++--- .../src/toolbox/overlapFeatures.test.ts | 48 ++++--- 9 files changed, 382 insertions(+), 155 deletions(-) create mode 100644 packages/geoprocessing/data/in/squares.fgb create mode 100644 packages/geoprocessing/data/in/squaresReadme.txt diff --git a/packages/geoprocessing/data/in/squares.fgb b/packages/geoprocessing/data/in/squares.fgb new file mode 100644 index 0000000000000000000000000000000000000000..0c22598a0624ba5650aca501f686cad14a1d2826 GIT binary patch literal 2328 zcmb7F&2G~`5Z=-X0#qduAfO0jtR9NwMzNjWQ=K2njpQa#oQk55gWGHpOOCh1uB!4J z95`^~z(epnoO|TRtnFzMw<%$y-PxJ_cIMOUjy)WmtPe*gYdaf+>=2Y~Sf|J)d4LX* zCNE+AjBH1qbrZA@dI$+k+c?VM4D&uKcCxE>ceUavTTIe31r;@ z&oRXMohGCn$IOE^^p;WUSUvHBVF{(2DCtd0KdhQMc-Yh(2nJ;X8aStdb?FCmBFN=Z zPN1GoCnqiyr9%Mgojbw1-Kp*QPVipruLL)WYIbF8si>}umF4{Ef#pImw|eAaL0K8B z$ZDB`b<=FLtyZHxD}F&OmSnXkDdkc|$rlwx%@rPRA{PRF8@l`2ic)T0OkI)WW=X0mcImsgdtl9$Wn zoT|d%n$@GO>zw(_8Q89*^rgyi1761nUx8}}PH;Y;!meq;V;=Pafei(~RXFw=j4gd-jBaS|YQ4=Dk0Ylr~%Q72>Y;7yXDsjkvV-a}gL@h{HH( zt-X*K{iqR7v_A{D8^N{MqkX$~V{guZaj*8X@Gau<1I8u{{?+7PFJ8M63|_l;FbH`K zgPjMyGoalIR=sR9_p-`@fK58iXdJ+9bc&yj&OHJh$uNju^RpVCm~ zx#qybx$^ra;kQ1?wad<8qW|WJ`H@%BUgk$!O5^psi|3n==L?u`;c3$0-SrF)!-V;g zbwV3?B0g!SwC}K$y!R~lcr9Or$DYDGw%uU^{v~r)58mZ<#Qdn2@g!Q9f*>wwU+sSd zz-@Kh0YB&XBnvkJ23H+Sba~Kgj=RfKe9-5o3 O>k|9WMvc& { test("getFeaturesForBBoxes - simple", async () => { - const canonicalStr = canonicalize([ - { - id: 0, // this is not in the data, but fgb client automatically adds it on deserialize as of v3.36.0 - type: "Feature", - properties: { - name: "World boundary", - description: "World", - }, - geometry: { - coordinates: [ - [ - [-180, 90], - [-180, -90], - [180, -90], - [180, 90], - [-180, 90], - ], - ], - type: "Polygon", - }, - }, - ]); + const worldJson = fs.readJsonSync("data/in/world.json"); + // pull features out of FC and add index based ID, just as the flatgeobuf client does on read + const worldFeatures = worldJson.features.map((f, index) => { + f.id = index; + return f; + }); + const canonicalStr = canonicalize(worldFeatures); + const url = "http://127.0.0.1:8080/data/in/world.fgb"; + const features = await getFeaturesForBBoxes([[-1, -1, 1, 1]], url); + expect(features.length).toEqual(1); + expect(canonicalize(features)).toEqual(canonicalStr); + }); +}); + +describe("getFeaturesForSketchBBoxes", () => { + test("getFeaturesForSketchBBoxes - simple", async () => { + const worldJson = fs.readJsonSync("data/in/world.json"); + // pull features out of FC and add index based ID, just as the flatgeobuf client does on read + const worldFeatures = worldJson.features.map((f, index) => { + f.id = index; + return f; + }); + const canonicalStr = canonicalize(worldFeatures); const url = "http://127.0.0.1:8080/data/in/world.fgb"; - const features = await loadFgb(url); + const poly = polygon([ + [ + [0, 0], + [1, 0], + [1, 1], + [0, 1], + [0, 0], + ], + ]); + const sketch = genSampleSketch(poly.geometry, "sketch1"); + const features = await getFeaturesForSketchBBoxes(sketch, url); expect(features.length).toEqual(1); expect(canonicalize(features)).toEqual(canonicalStr); }); + + test("getFeaturesForSketchBBoxes - bottom left squares", async () => { + const url = "http://127.0.0.1:8080/data/in/squares.fgb"; + const poly = polygon([ + [ + [0, 0], + [1, 0], + [1, 1], + [0, 1], + [0, 0], + ], + ]); + const sketch = genSampleSketch(poly.geometry, "sketch1"); + const features = await getFeaturesForSketchBBoxes(sketch, url); + // Should pick up twoByPoly, insideTwoByPoly, and the corner of halfInsideTwoByPoly + expect(features.length).toEqual(3); + }); + + test("getFeaturesForSketchBBoxes - sketch collection", async () => { + const url = "http://127.0.0.1:8080/data/in/squares.fgb"; + const testSC: SketchCollection = { + type: "FeatureCollection", + properties: { + id: "test", + name: "Collection 1", + updatedAt: "2021-11-20T00:00:34.269Z", + createdAt: "2021-11-19T23:34:12.889Z", + sketchClassId: "615b65a2aac8c8285d50d9f3", + isCollection: true, + userAttributes: [], + }, + bbox: bbox( + featureCollection([ + fix.outsideTwoByPolyTopLeftSketch, + fix.outsideTwoByPolyBottomRightSketch, + ]), + ), + features: [ + fix.outsideTwoByPolyTopLeftSketch, + fix.outsideTwoByPolyBottomRightSketch, + ], + }; + const features = await getFeaturesForSketchBBoxes(testSC, url); + // Should pick up outsideTwoByPolyTopLeftSketch, outsideTwoByPolyBottomRightSketch, and the corner of halfInsideTwoByPoly + expect(features.length).toEqual(3); + }); }); diff --git a/packages/geoprocessing/src/testing/fixtures/squareSketches.ts b/packages/geoprocessing/src/testing/fixtures/squareSketches.ts index 066b1ac0fd..5a958e96d7 100644 --- a/packages/geoprocessing/src/testing/fixtures/squareSketches.ts +++ b/packages/geoprocessing/src/testing/fixtures/squareSketches.ts @@ -27,7 +27,7 @@ const tiny: Feature = feature({ ], }); -const outer: Feature = feature({ +const twoByPoly: Feature = feature({ type: "Polygon", coordinates: [ [ @@ -39,9 +39,9 @@ const outer: Feature = feature({ ], ], }); -const outerArea = area(outer); +const twoByPolyArea = area(twoByPoly); -const outerOuter: Feature = feature({ +const fourByPoly: Feature = feature({ type: "Polygon", coordinates: [ [ @@ -53,10 +53,10 @@ const outerOuter: Feature = feature({ ], ], }); -const outerOuterArea = area(outerOuter); +const fourByPolyArea = area(fourByPoly); // fully inside outer -const poly1 = polygon([ +const insideTwoByPoly = polygon([ [ [0, 0], [1, 0], @@ -66,16 +66,21 @@ const poly1 = polygon([ ], ]); -const multiPoly1 = multiPolygon([poly1.geometry.coordinates]); -const sketchMultiPoly1 = genSampleSketch( - multiPoly1.geometry, +const insideTwoByMultiPoly = multiPolygon([ + insideTwoByPoly.geometry.coordinates, +]); +const insideTwoByMultipolySketch = genSampleSketch( + insideTwoByMultiPoly.geometry, "sketchMultiPoly1", ); -const sketch1 = genSampleSketch(poly1.geometry, "sketch1"); +const insideTwoByPolySketch = genSampleSketch( + insideTwoByPoly.geometry, + "sketch1", +); // half inside outer -const poly2 = polygon([ +const halfInsideTwoByPoly = polygon([ [ [1, 1], [3, 1], @@ -84,7 +89,7 @@ const poly2 = polygon([ [1, 1], ], ]); -const poly2Inner = polygon([ +const fullyInsideTwoPoly = polygon([ [ [1, 1], [2, 1], @@ -93,10 +98,13 @@ const poly2Inner = polygon([ [1, 1], ], ]); -const sketch2 = genSampleSketch(poly2.geometry, "sketch2"); +const halfInsideTwoBySketchPoly = genSampleSketch( + halfInsideTwoByPoly.geometry, + "sketch2", +); -// fully outside outer -const poly3 = polygon([ +// fully outside outer top right +const outsideTwoByPolyTopRight = polygon([ [ [3, 3], [4, 3], @@ -105,7 +113,40 @@ const poly3 = polygon([ [3, 3], ], ]); -const sketch3 = genSampleSketch(poly3.geometry, "sketch3"); +const outsideTwoByPolyTopRightSketch = genSampleSketch( + outsideTwoByPolyTopRight.geometry, + "sketch3", +); + +// fully outside outer bottom right +const outsideTwoByPolyBottomRight = polygon([ + [ + [3, 0], + [4, 0], + [4, 1], + [3, 1], + [3, 0], + ], +]); +const outsideTwoByPolyBottomRightSketch = genSampleSketch( + outsideTwoByPolyBottomRight.geometry, + "outsideTwoByPolyBottomRight", +); + +// fully outside outer bottom right +const outsideTwoByPolyTopLeft = polygon([ + [ + [0, 3], + [1, 3], + [1, 4], + [0, 4], + [0, 3], + ], +]); +const outsideTwoByPolyTopLeftSketch = genSampleSketch( + outsideTwoByPolyTopLeft.geometry, + "outsideTwoByPolyTopLeft", +); const collectionId = "CCCC"; const sketchCollection: SketchCollection = { @@ -119,8 +160,18 @@ const sketchCollection: SketchCollection = { isCollection: true, userAttributes: [], }, - bbox: bbox(featureCollection([sketch1, sketch2, sketch3])), - features: [sketch1, sketch2, sketch3], + bbox: bbox( + featureCollection([ + insideTwoByPolySketch, + halfInsideTwoBySketchPoly, + outsideTwoByPolyTopRightSketch, + ]), + ), + features: [ + insideTwoByPolySketch, + halfInsideTwoBySketchPoly, + outsideTwoByPolyTopRightSketch, + ], }; const mixedCollectionId = "MMMM"; @@ -135,8 +186,13 @@ const mixedPolySketchCollection: SketchCollection = { isCollection: true, userAttributes: [], }, - bbox: bbox(featureCollection([sketch1, multiPoly1])), - features: [sketch1, sketchMultiPoly1], + bbox: bbox( + featureCollection([ + insideTwoByPolySketch, + insideTwoByMultiPoly, + ]), + ), + features: [insideTwoByPolySketch, insideTwoByMultipolySketch], }; const scArea = area(sketchCollection); @@ -153,24 +209,35 @@ const overlapCollection: SketchCollection = { isCollection: true, userAttributes: [], }, - bbox: bbox(featureCollection([sketch1, sketch2])), - features: [sketch1, sketch2, sketch2], + bbox: bbox( + featureCollection([insideTwoByPolySketch, halfInsideTwoBySketchPoly]), + ), + features: [ + insideTwoByPolySketch, + halfInsideTwoBySketchPoly, + halfInsideTwoBySketchPoly, + ], }; export default { tiny, - outer, - outerArea, - outerOuterArea, - poly1, - multiPoly1, - sketch1, - sketchMultiPoly1, - poly2, - poly2Inner, - sketch2, - poly3, - sketch3, + twoByPoly, + twoByPolyArea, + fourByPoly, + fourByPolyArea, + insideTwoByPoly, + insideTwoByMultiPoly, + insideTwoByPolySketch, + insideTwoByMultipolySketch, + halfInsideTwoByPoly, + fullyInsideTwoPoly, + halfInsideTwoBySketchPoly, + outsideTwoByPolyTopRight, + outsideTwoByPolyTopRightSketch, + outsideTwoByPolyBottomRight, + outsideTwoByPolyBottomRightSketch, + outsideTwoByPolyTopLeft, + outsideTwoByPolyTopLeftSketch, collectionId, mixedCollectionId, sketchCollection, diff --git a/packages/geoprocessing/src/toolbox/area.test.ts b/packages/geoprocessing/src/toolbox/area.test.ts index 1d4ebeb845..fc625d968a 100644 --- a/packages/geoprocessing/src/toolbox/area.test.ts +++ b/packages/geoprocessing/src/toolbox/area.test.ts @@ -9,13 +9,15 @@ describe("area", () => { }); test("area - sketch polygon", async () => { - const metrics = await area(fix.sketch1); + const metrics = await area(fix.insideTwoByPolySketch); expect(metrics.length).toBe(1); expect(metrics[0].value).toBeCloseTo(12_363_718_145.180_046); }); test("area - sketch polygon set metric id", async () => { - const metrics = await area(fix.sketch1, { metricId: "specialArea" }); + const metrics = await area(fix.insideTwoByPolySketch, { + metricId: "specialArea", + }); expect(metrics.length).toBe(1); expect(metrics[0].metricId).toBe("specialArea"); }); diff --git a/packages/geoprocessing/src/toolbox/genPreprocessor.test.ts b/packages/geoprocessing/src/toolbox/genPreprocessor.test.ts index 9b81901fd1..accbfcc54d 100644 --- a/packages/geoprocessing/src/toolbox/genPreprocessor.test.ts +++ b/packages/geoprocessing/src/toolbox/genPreprocessor.test.ts @@ -126,30 +126,30 @@ describe("genClipToPolygonsPreprocessor", () => { test("genClipToPolygonsPreprocessor should successfully generate and run preprocessor", async () => { const featureOperations: FeatureClipOperation[] = [ { - clipFeatures: [fix.outer], + clipFeatures: [fix.twoByPoly], operation: "intersection", }, ]; const preprocessor = genClipToPolygonFeatures(featureOperations); - const result = await preprocessor(fix.poly2); + const result = await preprocessor(fix.halfInsideTwoByPoly); expect(result).toBeTruthy(); - expect(area(result)).toBe(area(fix.poly2Inner)); + expect(area(result)).toBe(area(fix.fullyInsideTwoPoly)); }, 60_000); test("geoprocessorz - sketch outside of datasource should not clip at all", async () => { const featureOperations: FeatureClipOperation[] = [ { - clipFeatures: [fix.outer], + clipFeatures: [fix.twoByPoly], operation: "difference", }, ]; const preprocessor = genClipToPolygonFeatures(featureOperations, {}); - const result = await preprocessor(fix.poly3); + const result = await preprocessor(fix.outsideTwoByPolyTopRight); expect(result).toBeTruthy(); - expect(area(result)).toBe(area(fix.poly3)); // should be same as input + expect(area(result)).toBe(area(fix.outsideTwoByPolyTopRight)); // should be same as input }, 20_000); }); diff --git a/packages/geoprocessing/src/toolbox/overlapArea.test.ts b/packages/geoprocessing/src/toolbox/overlapArea.test.ts index cbdd63f0fc..1b5f7e42ab 100644 --- a/packages/geoprocessing/src/toolbox/overlapArea.test.ts +++ b/packages/geoprocessing/src/toolbox/overlapArea.test.ts @@ -12,10 +12,10 @@ describe("overlapArea", () => { }); test("outerArea", () => { - expect(fix.outerArea).toBeCloseTo(49_447_340_364.086_09); + expect(fix.twoByPolyArea).toBeCloseTo(49_447_340_364.086_09); }); test("outerOuterArea", () => { - expect(fix.outerOuterArea).toBeCloseTo(197_668_873_521.434_88); + expect(fix.fourByPolyArea).toBeCloseTo(197_668_873_521.434_88); }); test("overlapArea - undefined sketch throws", async () => { @@ -26,51 +26,77 @@ describe("overlapArea", () => { // sketch always assumed to be within outer boundary. outerArea is passed as pre-calculated area avoiding need to compute it on the fly test("overlapArea overall - single polygon fully inside", async () => { - const metrics = await overlapArea("test", fix.sketch1, fix.outerArea); + const metrics = await overlapArea( + "test", + fix.insideTwoByPolySketch, + fix.twoByPolyArea, + ); expect(metrics[0].value).toBeCloseTo(12_363_718_145.180_046); expect(metrics[1].value).toBeCloseTo(0.25); // takes up bottom left quadrant of outer }); test("overlapSubarea - undefined sketch throws", async () => { expect( - async () => await overlapSubarea("test", undefined!, fix.outer), + async () => await overlapSubarea("test", undefined!, fix.twoByPoly), ).rejects.toThrow(ValidationError); }); }); describe("overlapSubarea", () => { test("overlapSubarea - undefined subareaFeature returns zero value metrics", async () => { - const metrics = await overlapSubarea("test", fix.sketch1, undefined!); + const metrics = await overlapSubarea( + "test", + fix.insideTwoByPolySketch, + undefined!, + ); expect(metrics.length).toBe(2); for (const m of metrics) expect(m.value).toEqual(0); }); test("overlapSubarea intersect - single polygon fully inside", async () => { - const metrics = await overlapSubarea("test", fix.sketch1, fix.outer); + const metrics = await overlapSubarea( + "test", + fix.insideTwoByPolySketch, + fix.twoByPoly, + ); expect(metrics[0].value).toBeCloseTo(12_363_718_145.180_046); expect(metrics[1].value).toBeCloseTo(0.25); }); test("overlapSubarea difference - single polygon fully inside", async () => { - const metrics = await overlapSubarea("test", fix.sketch1, fix.outer, { - operation: "difference", - outerArea: fix.outerArea, - }); + const metrics = await overlapSubarea( + "test", + fix.insideTwoByPolySketch, + fix.twoByPoly, + { + operation: "difference", + outerArea: fix.twoByPolyArea, + }, + ); expect(metrics[0].value).toBeCloseTo(0); expect(metrics[1].value).toBeCloseTo(0); }); test("overlapSubarea intersect - single polygon fully outside", async () => { - const metrics = await overlapSubarea("test", fix.sketch3, fix.outer); + const metrics = await overlapSubarea( + "test", + fix.outsideTwoByPolyTopRightSketch, + fix.twoByPoly, + ); expect(metrics[0].value).toBeCloseTo(0); expect(metrics[1].value).toBeCloseTo(0); }); test("overlapSubarea difference - single polygon fully outside outer, inside of outerOuter", async () => { - const metrics = await overlapSubarea("test", fix.sketch3, fix.outer, { - operation: "difference", - outerArea: fix.outerOuterArea, - }); + const metrics = await overlapSubarea( + "test", + fix.outsideTwoByPolyTopRightSketch, + fix.twoByPoly, + { + operation: "difference", + outerArea: fix.fourByPolyArea, + }, + ); expect(metrics[0].value).toBeCloseTo(12_341_127_230.893_69); expect(metrics[1].value).toBeCloseTo(0.083_26); // should be 1 square of 16 in outerOuter }); @@ -80,7 +106,7 @@ describe("overlapSubarea", () => { const metrics = await overlapArea( "test", fix.sketchCollection, - fix.outerOuterArea, + fix.fourByPolyArea, ); const collPercMetric = firstMatchingMetric( metrics, @@ -97,7 +123,7 @@ describe("overlapSubarea", () => { const metrics = await overlapSubarea( "test", fix.sketchCollection, - fix.outer, + fix.twoByPoly, ); expect(area(fix.sketchCollection)).toBe(fix.scArea); @@ -126,10 +152,10 @@ describe("overlapSubarea", () => { const metrics = await overlapSubarea( "test", fix.sketchCollection, - fix.outer, + fix.twoByPoly, { operation: "difference", - outerArea: fix.outerOuterArea, + outerArea: fix.fourByPolyArea, }, ); diff --git a/packages/geoprocessing/src/toolbox/overlapFeatures.test.ts b/packages/geoprocessing/src/toolbox/overlapFeatures.test.ts index 5d094609aa..5f2da0435d 100644 --- a/packages/geoprocessing/src/toolbox/overlapFeatures.test.ts +++ b/packages/geoprocessing/src/toolbox/overlapFeatures.test.ts @@ -12,22 +12,26 @@ describe("overlapFeatures", () => { }); test("outerArea", () => { - expect(fix.outerArea).toBeCloseTo(49_447_340_364.086_09); + expect(fix.twoByPolyArea).toBeCloseTo(49_447_340_364.086_09); }); test("outerOuterArea", () => { - expect(fix.outerOuterArea).toBeCloseTo(197_668_873_521.434_88); + expect(fix.fourByPolyArea).toBeCloseTo(197_668_873_521.434_88); }); test("overlapFeatures - sketch polygon fully inside", async () => { - const metrics = await overlapFeatures("test", [fix.outer], fix.sketch1); - expect(metrics[0].value).toBeCloseTo(area(fix.sketch1)); + const metrics = await overlapFeatures( + "test", + [fix.twoByPoly], + fix.insideTwoByPolySketch, + ); + expect(metrics[0].value).toBeCloseTo(area(fix.insideTwoByPolySketch)); }); test("overlapFeatures - sketch polygon fully inside - truncation", async () => { const metricsNoTruncation = await overlapFeatures( "test", [fix.tiny], - fix.sketch1, + fix.insideTwoByPolySketch, { truncate: false, }, @@ -37,7 +41,7 @@ describe("overlapFeatures", () => { const metricsTruncation = await overlapFeatures( "test", [fix.tiny], - fix.sketch1, + fix.insideTwoByPolySketch, { truncate: true, }, @@ -47,7 +51,7 @@ describe("overlapFeatures", () => { const metricsTruncationDefault = await overlapFeatures( "test", [fix.tiny], - fix.sketch1, + fix.insideTwoByPolySketch, ); expect(metricsTruncationDefault[0].value).toBe(0.012_364); }); @@ -55,26 +59,30 @@ describe("overlapFeatures", () => { test("overlapFeatures - sketch multipolygon fully inside", async () => { const metrics = await overlapFeatures( "test", - [fix.outer], - fix.sketchMultiPoly1, + [fix.twoByPoly], + fix.insideTwoByMultipolySketch, ); - expect(metrics[0].value).toBeCloseTo(area(fix.sketchMultiPoly1)); + expect(metrics[0].value).toBeCloseTo(area(fix.insideTwoByMultipolySketch)); }); test("overlapFeatures - multipolygon both arguments", async () => { const metrics = await overlapFeatures( "test", - [fix.sketchMultiPoly1], - fix.sketchMultiPoly1, + [fix.insideTwoByMultipolySketch], + fix.insideTwoByMultipolySketch, ); - expect(metrics[0].value).toBeCloseTo(area(fix.sketchMultiPoly1)); + expect(metrics[0].value).toBeCloseTo(area(fix.insideTwoByMultipolySketch)); }); test.skip("overlapFeatures - sketch polygon half inside", async () => { - const metrics = await overlapFeatures("test", [fix.outer], fix.sketch2); + const metrics = await overlapFeatures( + "test", + [fix.twoByPoly], + fix.halfInsideTwoBySketchPoly, + ); expect(metrics.length).toEqual(1); // overlap should be ~50% of original sketch area - const areaOf2 = area(fix.sketch2); + const areaOf2 = area(fix.halfInsideTwoBySketchPoly); const percDiff = (metrics[0].value / (areaOf2 * 0.5)) % 1; expect(percDiff).toBeCloseTo(0); }); @@ -104,7 +112,11 @@ describe("overlapFeatures", () => { }); test("overlapFeatures - sketch polygon fully outside", async () => { - const metrics = await overlapFeatures("test", [fix.outer], fix.sketch3); + const metrics = await overlapFeatures( + "test", + [fix.twoByPoly], + fix.outsideTwoByPolyTopRightSketch, + ); expect(metrics.length).toEqual(1); expect(metrics[0].value).toBe(0); }); @@ -112,7 +124,7 @@ describe("overlapFeatures", () => { test("overlapFeatures - mixed poly sketch collection fully inside", async () => { const metrics = await overlapFeatures( "test", - [fix.outer], + [fix.twoByPoly], fix.mixedPolySketchCollection, ); expect(metrics.length).toBe(3); @@ -154,7 +166,7 @@ describe("overlapFeatures", () => { test("overlapFeatures - sketch collection half inside", async () => { const metrics = await overlapFeatures( "test", - [fix.outer], + [fix.twoByPoly], fix.sketchCollection, ); expect(metrics.length).toBe(4);