refactoring: Remove more obsoleted code, add copyright tab

This commit is contained in:
Pieter Vander Vennet 2023-04-07 04:23:45 +02:00
parent f8d34648a0
commit 042d400dc4
20 changed files with 44 additions and 342 deletions

View file

@ -1,4 +1,4 @@
import { FeatureSource , FeatureSourceForLayer } from "../FeatureSource"
import { FeatureSource, FeatureSourceForLayer } from "../FeatureSource"
import { Feature } from "geojson"
import { BBox } from "../../BBox"
import { GeoOperations } from "../../GeoOperations"
@ -26,9 +26,12 @@ export default class GeoIndexedStore implements FeatureSource {
public GetFeaturesWithin(bbox: BBox): Feature[] {
// TODO optimize
const bboxFeature = bbox.asGeoJson({})
return this.features.data.filter(
(f) => GeoOperations.intersect(f, bboxFeature) !== undefined
)
return this.features.data.filter((f) => {
if (f.geometry.type === "Point") {
return bbox.contains(<[number, number]>f.geometry.coordinates)
}
return GeoOperations.intersect(f, bboxFeature) !== undefined
})
}
}