Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to JTS 1.17.0 #48

Open
jericks opened this issue Jul 22, 2020 · 10 comments
Open

Upgrade to JTS 1.17.0 #48

jericks opened this issue Jul 22, 2020 · 10 comments

Comments

@jericks
Copy link

jericks commented Jul 22, 2020

JTS 1.17.0 changed the signature of the Polygon.getExteriorRing() method and it now returns a LinearRing instead of a LineString. This leads to this error when you try to use a current version of this library with JTS 1.17.0:

java.lang.NoSuchMethodError: org.locationtech.jts.geom.Polygon.getExteriorRing()Lorg/locationtech/jts/geom/LineString;

at com.wdtinc.mapbox_vector_tile.adapt.jts.JtsAdapter.toFeature(JtsAdapter.java:357)
at com.wdtinc.mapbox_vector_tile.adapt.jts.JtsAdapter.toFeatures(JtsAdapter.java:300)
at com.wdtinc.mapbox_vector_tile.adapt.jts.JtsAdapter$toFeatures$0.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:157)

The upgrade is pretty easy. There is only one code change in a test (in MvtReaderTest PackedCoordinateSequenceFactory constructor now only takes one parameter not two). I will follow up with a PR.

Thanks!
Jared

@devemux86
Copy link

devemux86 commented Jul 23, 2020

Please see #32 (comment)

Android JTS 1.16+ compatibility remains the same(?) forcing Java 8 and Android 7 Nougat (--min-api 24).

Related to locationtech/jts#145

@jericks
Copy link
Author

jericks commented Jul 24, 2020

That is a problem. Projects like GeoTools have already upgraded JTS. I wonder, could we create a 3.x branch that stays on JTS 1.15 and a 4.x branch that upgrades to 1.17?

@ShibaBandit
Copy link
Member

Yes this has come up before. Either need to provide two versions at the library level or have applications shade the dependencies.

@electricsam
Copy link

I am also running into this issue. All of the projects that I work on use JTS 1.18.

@i23098
Copy link

i23098 commented Oct 23, 2021

There's a pull request for JTS 1.18 - #52

Would be great if the dependency could be upgraded even if it meant 2 versions of the library. As other projects (like GeoTools) upgrade JTS, starts to become a big issue.

@i23098
Copy link

i23098 commented Nov 11, 2021

Since it seems there's no development being done in this project :( I raised an issue in Java - https://bugs.openjdk.java.net/browse/JDK-8276963

If Java fixes it, we could upgrade JTS dependency without getting the exception... They set it as a P4, so, not that much hope :(

Edit: Seems it works as specified by the Java Specification, so, the only way we can have this fixed is by upgrading the JTS dependency and rebuild...

@CodeK1988
Copy link

pls update. thank you

@ggyyso
Copy link

ggyyso commented Feb 20, 2023 via email

@ralmeida-espatial
Copy link

Just so others hitting this issue know, there's a fork that is being updated - https://github.com/sebasbaumh/mapbox-vector-tile-java

@CodeK1988
Copy link

thank you,mate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants