Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
- fixed type cast exception
  • Loading branch information
temi committed Sep 25, 2024
1 parent 12b6dc2 commit 94bec0a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions grails-app/services/au/org/ala/ecodata/SpatialService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down

0 comments on commit 94bec0a

Please sign in to comment.