forked from MapComplete/MapComplete
Repair import flow
This commit is contained in:
parent
8c7bb92f8a
commit
e1cdb75001
7 changed files with 85 additions and 74 deletions
|
@ -1,10 +1,10 @@
|
|||
import { Store } from "../../Logic/UIEventSource"
|
||||
import { GeoOperations } from "../../Logic/GeoOperations"
|
||||
import { Feature, Geometry } from "@turf/turf"
|
||||
import { Feature, Point } from "geojson"
|
||||
|
||||
export class ImportUtils {
|
||||
public static partitionFeaturesIfNearby(
|
||||
toPartitionFeatureCollection: { features: Feature<Geometry>[] },
|
||||
toPartitionFeatureCollection: { features: Feature[] },
|
||||
compareWith: Store<{ features: Feature[] }>,
|
||||
cutoffDistanceInMeters: Store<number>
|
||||
): Store<{ hasNearby: Feature[]; noNearby: Feature[] }> {
|
||||
|
@ -25,7 +25,7 @@ export class ImportUtils {
|
|||
(f) =>
|
||||
maxDist >=
|
||||
GeoOperations.distanceBetween(
|
||||
<any>toImportElement.geometry.coordinates,
|
||||
<any>(<Point>toImportElement.geometry).coordinates,
|
||||
GeoOperations.centerpointCoordinates(f)
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue