Skip to content

Commit a7e89eb

Browse files
committed
Merge branch 'feat/dggs-support' of https://github.com/opengeoshub/GeoLibre into feat/dggs-support
2 parents 5825a51 + f6d9e25 commit a7e89eb

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tests/dggrid-plugin.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ describe("DGGRID plugin helpers", () => {
103103
const engine = await loadDggrid();
104104
const grid = dggridGridForBounds(engine, [179.6, -0.3, -179.6, 0.3], 8);
105105
assert.ok(grid.features.length > 0);
106+
// A cell that only clips the 0.8° x 0.6° box must stay contiguous.
107+
for (const feature of grid.features) {
108+
const lons = feature.geometry.coordinates[0].map(([lng]) => lng);
109+
assert.ok(Math.max(...lons) - Math.min(...lons) < 180);
110+
}
111+
// The box is tiny, so a normalization bug that collects distant cells fails here.
112+
assert.ok(grid.features.length < 200, String(grid.features.length));
106113
});
107114

108115
it("fills bounds for the other cell types and projections", async () => {

0 commit comments

Comments
 (0)