Skip to content

Commit

Permalink
fix for long string
Browse files Browse the repository at this point in the history
  • Loading branch information
temi committed Oct 2, 2024
1 parent e212fbf commit 31a6069
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/groovy/au/org/ala/ecodata/GeometryUtils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class GeometryUtils {

static Map wktToGeoJson(String wkt, int decimals = 20) {
WKTReader wktReader = new WKTReader()
Geometry geom = wktReader.read(wkt)
def reader = new StringReader(wkt)
Geometry geom = wktReader.read(reader)
String geoJSON = new GeometryJSON(decimals).toString(geom)
ObjectMapper mapper = new ObjectMapper()
return mapper.readValue(geoJSON, Map)
Expand Down

0 comments on commit 31a6069

Please sign in to comment.