From bdc179a9b61107851e3f36e111c7011d519e4280 Mon Sep 17 00:00:00 2001 From: jeafreezy Date: Thu, 5 Dec 2024 15:27:58 +0100 Subject: [PATCH] wip: geojson2osm --- frontend/src/app/providers/models-provider.tsx | 12 ++++++------ .../start-mapping/components/model-header.tsx | 2 +- frontend/src/lib/geojson2xml.ts | 4 ++++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/providers/models-provider.tsx b/frontend/src/app/providers/models-provider.tsx index 200e2006..10e1699d 100644 --- a/frontend/src/app/providers/models-provider.tsx +++ b/frontend/src/app/providers/models-provider.tsx @@ -31,7 +31,7 @@ import { import { LngLatBoundsLike } from "maplibre-gl"; import { useModelDetails } from "@/features/models/hooks/use-models"; import { useGetTrainingDataset } from "@/features/models/hooks/use-dataset"; -import { useAuth } from "./auth-provider"; + import { TOAST_NOTIFICATIONS } from "@/contents"; /** @@ -223,8 +223,8 @@ const ModelsContext = createContext<{ validateEditMode: boolean; }>({ formData: initialFormState, - setFormData: () => {}, - handleChange: () => {}, + setFormData: () => { }, + handleChange: () => { }, createNewTrainingDatasetMutation: {} as UseMutationResult< TTrainingDataset, Error, @@ -239,13 +239,13 @@ const ModelsContext = createContext<{ >, hasLabeledTrainingAreas: false, hasAOIsWithGeometry: false, - resetState: () => {}, + resetState: () => { }, isEditMode: false, modelId: "", getFullPath: () => "", - handleModelCreationAndUpdate: () => {}, + handleModelCreationAndUpdate: () => { }, trainingDatasetCreationInProgress: false, - handleTrainingDatasetCreation: () => {}, + handleTrainingDatasetCreation: () => { }, validateEditMode: false, }); diff --git a/frontend/src/features/start-mapping/components/model-header.tsx b/frontend/src/features/start-mapping/components/model-header.tsx index 6392d815..10ef4123 100644 --- a/frontend/src/features/start-mapping/components/model-header.tsx +++ b/frontend/src/features/start-mapping/components/model-header.tsx @@ -7,7 +7,7 @@ import { SkeletonWrapper } from "@/components/ui/skeleton"; import { APPLICATION_CONTENTS, TOAST_NOTIFICATIONS } from "@/contents"; import { ModelDetailsPopUp } from "@/features/models/components"; import { useDropdownMenu } from "@/hooks/use-dropdown-menu"; -import { geojson2osm } from "@/lib/geojson2xml"; + import { Feature, TileJSON, diff --git a/frontend/src/lib/geojson2xml.ts b/frontend/src/lib/geojson2xml.ts index 4547c4f8..d6030ea0 100644 --- a/frontend/src/lib/geojson2xml.ts +++ b/frontend/src/lib/geojson2xml.ts @@ -5,21 +5,25 @@ class Node { lat: number; lon: number; tags: Record; + id: number constructor(coordinates: [number, number]) { this.lat = coordinates[1]; this.lon = coordinates[0]; this.tags = {}; + this.id = 0 } } class Way { tags: Record; nodes: Node[]; + id: number constructor(properties: Record) { this.tags = properties; this.nodes = []; + this.id = 0 } }