Closed frastlin closed 3 years ago
Hello, Here are two functions that seem to work. If you remove the duplicate points, that would be fine IMO. The first function removes duplicates from a flattened array, and the second function goes through nested arrays until it hits the flattened array:
const filterFlattenedDuplicates = (input) =>
Array.from(new Set(input.map(JSON.stringify)), JSON.parse) // this removes duplicate points from a list of points
let filterDuplicates = poly =>
poly[0][0].length === undefined ? filterFlattenedDuplicates(poly) : poly.map(p=>filterDuplicates(p))
Hello @frastlin ,
Creation of polygons complient with Geojson spec since v1.2.20, see example https://next.observablehq.com/@alexbol99/support-geojson-polygon-issue-79
Issue closed,
Best regards, Alex Bol
Hello, I'm wondering if shapes that end with the starting point can please be made valid shapes? The Geojson spec states: " o The first and last positions are equivalent, and they MUST contain identical values; their representation SHOULD also be identical."
should return "true".