Skip to content

Commit

Permalink
Fix editing of WKT polygons from test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Jun 11, 2024
1 parent b9b36d8 commit 2516336
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 11 additions & 2 deletions web/src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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: {},
});
}
</script>

<Layout>
<div slot="left">
<h1>Polygon width</h1>
<a href="https://github.com/dabreegster/polygon-width?tab=readme-ov-file#polygon-width" target="_blank">About</a>
<a
href="https://github.com/dabreegster/polygon-width?tab=readme-ov-file#polygon-width"
target="_blank"
>
About
</a>

<details open>
<summary>Input</summary>
Expand Down
2 changes: 2 additions & 0 deletions web/src/test_cases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit 2516336

Please sign in to comment.