Skip to content

Commit

Permalink
wip: geojson2osm
Browse files Browse the repository at this point in the history
  • Loading branch information
jeafreezy committed Dec 5, 2024
1 parent 63bb943 commit bdc179a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
12 changes: 6 additions & 6 deletions frontend/src/app/providers/models-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down Expand Up @@ -223,8 +223,8 @@ const ModelsContext = createContext<{
validateEditMode: boolean;
}>({
formData: initialFormState,
setFormData: () => {},
handleChange: () => {},
setFormData: () => { },
handleChange: () => { },
createNewTrainingDatasetMutation: {} as UseMutationResult<
TTrainingDataset,
Error,
Expand All @@ -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,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/lib/geojson2xml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,25 @@ class Node {
lat: number;
lon: number;
tags: Record<string, string>;
id: number

constructor(coordinates: [number, number]) {
this.lat = coordinates[1];
this.lon = coordinates[0];
this.tags = {};
this.id = 0
}
}

class Way {
tags: Record<string, string>;
nodes: Node[];
id: number

constructor(properties: Record<string, string>) {
this.tags = properties;
this.nodes = [];
this.id = 0
}
}

Expand Down

0 comments on commit bdc179a

Please sign in to comment.