bjornharrtell / jts2geojson

JTS from/to GeoJSON converter for Java
MIT License
141 stars 57 forks source link

Support JTS 1.17 #40

Closed jiayuasu closed 3 years ago

jiayuasu commented 3 years ago

If use jts2geojson together with JTS 1.17+, the following exception will occur:

java.lang.NoSuchMethodError: org.locationtech.jts.geom.Polygon.getExteriorRing()Lorg/locationtech/jts/geom/LineString; at org.wololo.jts2geojson.GeoJSONWriter.convert(GeoJSONWriter.java:79) at org.wololo.jts2geojson.GeoJSONWriter.write(GeoJSONWriter.java:28)

Can you please support JTS 1.17+?

jiayuasu commented 3 years ago

According to JTS 1.17 release notes: https://github.com/locationtech/jts/releases

This is due to an API change:

API Changes

Change Polygon getExteriorRing and getInteriorRingN accessors to return LinearRing.

lockwobr commented 3 years ago

Version 1.18 is out now... any updates on this? if its so simple, and i open a pr for it would get merged?

jiayuasu commented 3 years ago

@lockwobr Yes, I also need this package to support 1.18 :-)

lockwobr commented 3 years ago

just opened a pr to fix this issue.

https://github.com/bjornharrtell/jts2geojson/pull/41