From be947c79f2e420b40bafe42e46dd8632eae46c9f Mon Sep 17 00:00:00 2001 From: Erick Otenyo Date: Thu, 16 May 2024 10:18:36 +0300 Subject: [PATCH 1/2] Change turf feature truncating precision to 6 from 2 --- capeditor/static/capeditor/js/widget/boundary-polygon-widget.js | 2 +- capeditor/static/capeditor/js/widget/polygon-draw-widget.js | 2 +- capeditor/static/capeditor/js/widget/polygon-widget.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/capeditor/static/capeditor/js/widget/boundary-polygon-widget.js b/capeditor/static/capeditor/js/widget/boundary-polygon-widget.js index 892f980..b9faea2 100644 --- a/capeditor/static/capeditor/js/widget/boundary-polygon-widget.js +++ b/capeditor/static/capeditor/js/widget/boundary-polygon-widget.js @@ -293,7 +293,7 @@ BoundaryPolygonWidget.prototype.addAdminBoundaryLayer = function () { } const truncatedFeature = turf.truncate(feature, { - precision: 2, + precision: 6, coordinates: 2, mutate: true }) diff --git a/capeditor/static/capeditor/js/widget/polygon-draw-widget.js b/capeditor/static/capeditor/js/widget/polygon-draw-widget.js index fc9985d..e0c9974 100644 --- a/capeditor/static/capeditor/js/widget/polygon-draw-widget.js +++ b/capeditor/static/capeditor/js/widget/polygon-draw-widget.js @@ -173,7 +173,7 @@ class PolygonDrawWidget { const truncatedFeature = turf.truncate(feature, { - precision: 2, + precision: 6, coordinates: 2, mutate: true }) diff --git a/capeditor/static/capeditor/js/widget/polygon-widget.js b/capeditor/static/capeditor/js/widget/polygon-widget.js index b46d83b..8e7df0f 100644 --- a/capeditor/static/capeditor/js/widget/polygon-widget.js +++ b/capeditor/static/capeditor/js/widget/polygon-widget.js @@ -329,7 +329,7 @@ PolygonWidget.prototype.setDrawData = function (featureGeom) { // truncate geometry const geometry = turf.truncate(featureGeom, { - precision: 2, + precision: 6, coordinates: 2, mutate: true }) From 15422e00057b86902ad2c07778790aa9f34f5181 Mon Sep 17 00:00:00 2001 From: Erick Otenyo Date: Thu, 16 May 2024 10:19:05 +0300 Subject: [PATCH 2/2] Bump version --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index ed2e190..0e53c74 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = capeditor -version = 0.5.5 +version = 0.5.6 description = Wagtail based CAP composer long_description = file:README.md long_description_content_type = text/markdown