This repository has been archived by the owner on Mar 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HARP-13254: Add a test to reproduce the bug.
This change adds an IBCT test case demonstrating the bug when extruding polygons touching the tile bounds. Signed-off-by: Roberto Raggi <roberto.raggi@here.com>
- Loading branch information
1 parent
beb6011
commit 4e82235
Showing
2 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright (C) 2021 HERE Europe B.V. | ||
* Licensed under Apache 2.0, see full license in LICENSE | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { TileKey, webMercatorTilingScheme } from "@here/harp-geoutils"; | ||
import { DataProvider } from "@here/harp-mapview-decoder"; | ||
import RBush from "geojson-rbush"; | ||
|
||
/** | ||
* A simple {@link @here/harp-mapview-decoder/DataProvider} that organizes GeoJson features using an rtree. | ||
* | ||
* The `GeoJsonStore` can be used as a {@link @here/harp-mapview-decoder/DataProvider} | ||
* of {@link @here/harp-vectortile-datasource/VectorTileDataSource}s. | ||
* | ||
* @example | ||
* ```typescript | ||
* const geoJsonStore = new GeoJsonStore(); | ||
* | ||
* const dataSource = new VectorTileDataSource({ | ||
* dataProvider: geoJsonStore, | ||
* // ... | ||
* }); | ||
* | ||
* geoJsonStore.features.insert(polygonFeature); | ||
* geoJsonStore.features.insert(lineStringFeature); | ||
* // ... | ||
* ``` | ||
*/ | ||
export class GeoJsonStore extends DataProvider { | ||
/** | ||
* The set of GeoJson features organized by this this `GeoJsonStore`. | ||
*/ | ||
readonly features = RBush(); | ||
|
||
ready(): boolean { | ||
return true; | ||
} | ||
|
||
async getTile(tileKey: TileKey) { | ||
const { west, south, east, north } = webMercatorTilingScheme.getGeoBox(tileKey); | ||
const features = this.features.search([west, south, east, north]); | ||
return features; | ||
} | ||
|
||
protected async connect(): Promise<void> {} | ||
|
||
protected dispose(): void {} | ||
} |