From 251633663e4523c3b121ab235b9fffb5c33134f2 Mon Sep 17 00:00:00 2001 From: Dustin Carlino Date: Tue, 11 Jun 2024 17:04:49 +0100 Subject: [PATCH] Fix editing of WKT polygons from test cases --- web/src/App.svelte | 13 +++++++++++-- web/src/test_cases.ts | 2 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/web/src/App.svelte b/web/src/App.svelte index ad28ae6..9c19958 100644 --- a/web/src/App.svelte +++ b/web/src/App.svelte @@ -108,14 +108,23 @@ // @ts-expect-error let test = testCases[currentTestCase]; shouldZoom = true; - inputString = JSON.stringify(parseWkt(test)); + inputString = JSON.stringify({ + type: "Feature", + geometry: parseWkt(test), + properties: {}, + }); }

Polygon width

- About + + About +
Input diff --git a/web/src/test_cases.ts b/web/src/test_cases.ts index 6f45f35..54e78de 100644 --- a/web/src/test_cases.ts +++ b/web/src/test_cases.ts @@ -6,6 +6,8 @@ export let testCases = { "POLYGON((-0.1021076 51.4896734,-0.1015438 51.489379,-0.10134 51.4895191,-0.101303 51.4894982,-0.1015399 51.4893283,-0.102142 51.4896457,-0.1021076 51.4896734))", "many width changes": "POLYGON((-0.1018838 51.4895115,-0.1017193 51.4894192,-0.1016939 51.4894361,-0.1016541 51.4894124,-0.1016219 51.4894303,-0.1015788 51.489405,-0.1016067 51.4893771,-0.1014222 51.4892885,-0.1015086 51.4892326,-0.1016694 51.4893138,-0.1016423 51.4893317,-0.1016804 51.4893581,-0.1017074 51.4893381,-0.1018361 51.4894213,-0.1018818 51.4894061,-0.1019284 51.4894366,-0.1019038 51.4894609,-0.1019443 51.4894764,-0.1018838 51.4895115))", + "not many perp lines in result": + "POLYGON((13.3562208 52.5297463,13.3560897 52.5299508,13.3569956 52.5304672,13.3562493 52.5304083,13.3558676 52.5300582,13.3555314 52.5296423,13.3562094 52.5294482,13.3568987 52.5294309,13.3577818 52.5295522,13.3583401 52.52993,13.3587674 52.5301692,13.3584882 52.5303771,13.3584939 52.5307341,13.3582318 52.5308485,13.3577989 52.5304568,13.3574285 52.5298918,13.3562208 52.5297463))", // from OSM area:highway "curvy L":