From 3796431dcc2022ad05b459dfd2e7de489a192f58 Mon Sep 17 00:00:00 2001 From: ebocher Date: Tue, 3 Sep 2024 16:21:22 +0200 Subject: [PATCH 1/2] Filter in the test fraction of vegetation to avoid precision effect --- .../geoindicators/WorkflowGeoIndicatorsTest.groovy | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/geoindicators/src/test/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicatorsTest.groovy b/geoindicators/src/test/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicatorsTest.groovy index 121952ae4c..f7c78ea120 100644 --- a/geoindicators/src/test/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicatorsTest.groovy +++ b/geoindicators/src/test/groovy/org/orbisgis/geoclimate/geoindicators/WorkflowGeoIndicatorsTest.groovy @@ -373,6 +373,7 @@ class WorkflowGeoIndicatorsTest { "", "", "", "", ["indicatorUse": indicatorUse, svfSimplified: false], prefixName) assertNotNull(geoIndicatorsCompute_i) + datasource.save(geoIndicatorsCompute_i.rsu_indicators, "/tmp/test4.geojson", true) checkRSUIndicators(datasource, geoIndicatorsCompute_i.rsu_indicators) if (indicatorUse.contains("UTRF")) { @@ -601,11 +602,11 @@ class WorkflowGeoIndicatorsTest { countResult = datasource.firstRow("select count(*) as count from ${rsuIndicatorsTableName} WHERE water_fraction>0".toString()) assertEquals(2, countResult.count) - //Check low_vegetation_fraction > 0 - countResult = datasource.firstRow("select count(*) as count from ${rsuIndicatorsTableName} WHERE low_vegetation_fraction>0".toString()) - assertEquals(55, countResult.count) + //Check low_vegetation_fraction > 0.001 + countResult = datasource.firstRow("select count(*) as count from ${rsuIndicatorsTableName} WHERE low_vegetation_fraction>0.001".toString()) + assertEquals(49, countResult.count) - //Check low_vegetation_fraction > 0 + //Check impervious_fraction > 0 countResult = datasource.firstRow("select count(*) as count from ${rsuIndicatorsTableName} WHERE impervious_fraction>0".toString()) assertEquals(0, countResult.count) } From b4f231b58a4a441d306d65e142f90990dc7f5229 Mon Sep 17 00:00:00 2001 From: ebocher Date: Tue, 3 Sep 2024 16:22:49 +0200 Subject: [PATCH 2/2] Filter in the test fraction of vegetation to avoid precision effect --- docs/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index a41082d26e..886c5cf5fb 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,3 +1,4 @@ ## Changelog for v1.0.1 - Upgrade dependencies H2, H2GIS, JTS and Groovy +- Fix some tests due to some rounding precision in JTS 1.20