sadfasdf
This commit is contained in:
@@ -107,7 +107,13 @@ const sanitizePolygon = (coords) => {
|
||||
} else { return [pts[0], pts[pts.length-1]]; }
|
||||
};
|
||||
try { filtered = rdp(filtered, EPS_DEG); } catch {}
|
||||
return filtered;
|
||||
// Ensure at least 3 unique points remain; if not, fall back to original coords
|
||||
const unique = [];
|
||||
for (const p of filtered) {
|
||||
if (!unique.some(q => Math.abs(q[0]-p[0])<1e-9 && Math.abs(q[1]-p[1])<1e-9)) unique.push(p);
|
||||
}
|
||||
if (unique.length < 3) return coords;
|
||||
return unique;
|
||||
};
|
||||
|
||||
// @route GET /api/properties
|
||||
|
||||
Reference in New Issue
Block a user