From 94bec0a654f134c027e10084982e41b0657de195 Mon Sep 17 00:00:00 2001 From: temi Date: Wed, 25 Sep 2024 16:27:03 +1000 Subject: [PATCH] AtlasOfLivingAustralia/fieldcapture#3292 - fixed type cast exception --- grails-app/services/au/org/ala/ecodata/SpatialService.groovy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/grails-app/services/au/org/ala/ecodata/SpatialService.groovy b/grails-app/services/au/org/ala/ecodata/SpatialService.groovy index eb4146726..82e3391a1 100644 --- a/grails-app/services/au/org/ala/ecodata/SpatialService.groovy +++ b/grails-app/services/au/org/ala/ecodata/SpatialService.groovy @@ -68,11 +68,12 @@ class SpatialService { } else { geo = GeometryUtils.geoJsonMapToGeometry (geoJson) GeometryCollection geometryCollection = (GeometryCollection)geo + Geometry correctGeometry = geometryCollection if(!geometryCollection.isValid()) { - geometryCollection = geometryCollection.buffer(0) + correctGeometry = geometryCollection.buffer(0) } - Geometry convexHullGeometry = geometryCollection.union().convexHull() + Geometry convexHullGeometry = correctGeometry.union().convexHull() wkt = convexHullGeometry.toText() }