0

I am experimenting with Geotools java library, and specificaly with the smooth method. In the Geotools documentation there is this example:

WKTReader reader = new WKTReader();
Geometry tShape = reader.read(
"POLYGON((10 0, 10 20, 0 20, 0 30, 30 30, 30 20, 20 20, 20 0, 10 0))");

Geometry tLoose = JTS.smooth(tShape, 0.0);
Geometry tTighter = JTS.smooth(tShape, 0.75);

when I execute this I keep getting this error:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/opengis/geometry/MismatchedDimensionException

in line Geometry tLoose = JTS.smooth(tShape, 0.0); (same happens with next line)

Why am I getting this error?

geo
  • 517
  • 1
  • 9
  • 28
  • Which version of GeoTools & JTS are you using? What are your imports for the code snippet? – Ian Turton Feb 09 '20 at 20:03
  • I am using jts v1.16.1, geotools v22.3. I think the problem is a case of the problem described here: https://stackoverflow.com/questions/16372883/exception-in-thread-awt-eventqueue-0-java-lang-noclassdeffounderror and I am currently trying to solve it using suggestions in that and other related threads. – geo Feb 10 '20 at 04:37
  • possibly, please add the mvn dependency tree results to the question. – Ian Turton Feb 10 '20 at 08:19

0 Answers0