Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#21670 closed defect (fixed)

[PATCH] Update JTS to use ivy, update JTS from 1.16.1 to 1.18.2

Reported by: taylor.smock Owned by: Don-vip
Priority: normal Milestone:
Component: Plugin jts Version:
Keywords: Cc:

Description

I'm going to be uploading two patches. The first patch should be binary compatible with the current suite of plugins (it keeps the current jts version). I am not updating the jts version until I get the dependent plugins onto ivy.

The second patch updates jts from 1.16.1 to 1.18.2.

See https://github.com/locationtech/jts/blob/master/doc/JTS_Version_History.md for the full changelog for 1.16.1 -> 1.18.2.

THIS WILL REQUIRE RECOMPILATION OF AFFECTED PLUGINS
1.17 made a binary but source compatible API change
1.18 move some classes around and deprecated/removed some classes.

jts is used by the following plugins:

  • areaselector
  • cadastre-fr
    • Also depends upon geotools
  • Tracer-testing
    • Also depends upon geotools
  • matsim
    • Also depends upon geotools
  • opendata
    • Also depends upon geotools
  • conflation
  • geotools (non-ivy)
    • ImportImagePlugin (doesn't appear to have libs in tree)
    • Tracer-testing (tracer/tracer2 didn't appear to have libs in tree)
    • cadastre-fr (nothing needed)
    • matsim (gradle)
    • opendata (non-ivy)

Attachments (2)

21670.patch (2.8 KB ) - added by taylor.smock 3 years ago.
21670.jts_update.patch (730 bytes ) - added by taylor.smock 3 years ago.
Update JTS from 1.16.1 to 1.18.2. Potentially binary/source incompatible.

Download all attachments as: .zip

Change History (20)

by taylor.smock, 3 years ago

Attachment: 21670.patch added

by taylor.smock, 3 years ago

Attachment: 21670.jts_update.patch added

Update JTS from 1.16.1 to 1.18.2. Potentially binary/source incompatible.

comment:2 by Don-vip, 3 years ago

In 35884/osm:

see #21670 - Update plugin JTS to use ivy

comment:3 by Don-vip, 3 years ago

In 35886/osm:

see #21670 - Update JTS from 1.16.1 to 1.18.2

comment:4 by Don-vip, 3 years ago

In 35887/osm:

see #21670 - Update settings

comment:5 by taylor.smock, 3 years ago

Heads up: there was a report on the OSM World Discord server about the conflation plugin not working.

I ran into a weird error with the Conflation plugin, apparently due to a compatibility with the Java Topology Suite, https://github.com/locationtech/jts/issues/805. I was able to fix it by downloading the unaffected version, https://github.com/locationtech/jts/releases/tag/jts-1.16.1, and merging it into the plugin jar. If you find that the Conflation plugin doesn't show any matches, try repeating my steps. I'd upload my jar but Discord doesn't like it.

It looks like we just need to do a rebuild for conflation.

EDIT: And I really need to get around to touching geotools.

Last edited 3 years ago by taylor.smock (previous) (diff)

comment:6 by Don-vip, 3 years ago

Ah yes, I forgot many plugins it seems.

comment:8 by SanderH, 3 years ago

I'm running into an issue I'm unable to resolve with our own plugin (for importing Dutch cadastre information) due to this JTS update.

We're using the JOSM geotools plugin and an additional plugin "geotools-wfs" because the JOSM version doesn't include gt-wfs-ng. However as this WFS is also using JTS and geotools, but as Geotools 22 is using JTS 1.16 (and kept pulling in this version via Maven dependency), I tried updating our Geotools to 26 which includes JTS 1.18. This has me now tunning into incompatibilities with the http libraries (at least I'm guessing that's what it is: Cause: java.lang.reflect.InvocationTargetException. Cause: java.lang.NoSuchFieldError: HTTP_CLIENT_FACTORY). Or something like that, I'm lost here...

This is getting very much beyond my limited Java skills. I'm mostly only trying to keep the plugin working (for both JOSM and the external WFS data changes) as the original author seems to have abandoned it.

Could you get the JOSM version of Geotools to include gt-wfs-ng so that we can ditch our extended geotools-wfs version so that we hopefully can get our plugin working again?

Thanks in advance!

in reply to:  8 comment:9 by taylor.smock, 3 years ago

@SanderH: Is the source code under an OSI approved license and is it publicly available? I'm not seeing anything in the JOSM plugins list.

If so, I can take a look at it to see what is going on. Otherwise, I'm not going to be able to do anything.

comment:10 by SanderH, 3 years ago

@taylor.smock:
Would be grateful if you could have a look, sources are here:
WFS: https://github.com/SanderH/josm-geotools-wfs
ODS: https://github.com/SanderH/josm-openservices/tree/0.6.20
BAG: https://github.com/SanderH/josm-ods-bag/tree/master
License seems to be GPLv3

It's not in the plugin list as we only distribute the plugins via a restricted sub forum (https://forum.openstreetmap.org/viewforum.php?id=94). Everyone with some experience in OSM can request access (https://forum.openstreetmap.org/viewtopic.php?id=55586) and others can request data updates here: https://forum.openstreetmap.org/viewtopic.php?id=52973.

With these 3 plugins enabled in JOSM you get an additional menu item "ODS" where you can enable the BAG plugin and download buildings and addresses from Dutch municipalities.

comment:11 by taylor.smock, 3 years ago

OK.

The problem is that you are using commons-httpclient-3.1.jar. At least based off of the given issue (java.lang.reflect.InvocationTargetException. Cause: java.lang.NoSuchFieldError: HTTP_CLIENT_FACTORY).

We also haven't updated geotools yet (see #20669).

EDIT: I'll look into updating your plugins once we've updated geotools.

Last edited 3 years ago by taylor.smock (previous) (diff)

comment:12 by taylor.smock, 3 years ago

And I am now surprised that the plugins were working prior to the plugin updates.

import org.openstreetmap.josm.Main -- Main was removed in r14253. And another class was moved in r12678. It wasn't as bad in the upstream codebase (how often do you rebase onto the upstream branch?).

Anyway, I've made PR's to the upstream repositories. It is up to you or the upstream author to merge them.

comment:13 by SanderH, 3 years ago

Thanks Taylor, I'll have a look.
The JOSM changes were breaking the plugin and were fixed in my fork. Upstream are the abandoned repositories. I'll probably manage to bring them back to my fork.
Thanks again!

in reply to:  13 comment:14 by taylor.smock, 3 years ago

Replying to SanderH:

Thanks Taylor, I'll have a look.
The JOSM changes were breaking the plugin and were fixed in my fork. Upstream are the abandoned repositories. I'll probably manage to bring them back to my fork.
Thanks again!

One that is (specifically) very far behind upstream was https://github.com/SanderH/josm-openservices . I highly recommend fetching upstream for that one.

comment:15 by Don-vip, 3 years ago

Resolution: fixed
Status: newclosed

comment:16 by SanderH, 3 years ago

Sorry to bother you again, it's still not working ;(

Found 2 possible causes, but not sure about that.

The maven repository you linked to the jts-SNAPTHOT in your PR points to https://josm.openstreetmap.de/nexus/content/repositories/snapshots/org/openstreetmap/josm/plugins/jts/SNAPSHOT/
There I only see an older jts version from 2020, where the plugin version says 35458, whereas JOSM now has a jts with version 35893 with a build date in 2022. Could it be that the snapshot directory doesn't yet have the new JTS version?

Another thing, in the geotools-wfs project, there are still all the older geotools 22.0 jar files in the lib folder. Should I replace those with the 26.1 versions which may be compiled against jst 1.18 instead of 1.16?

All compiles OK, but still getting stuck on the getExteriorRing function in the jts when actually using the plugins...

in reply to:  16 comment:17 by taylor.smock, 3 years ago

Replying to SanderH:

Sorry to bother you again, it's still not working ;(

Found 2 possible causes, but not sure about that.

The maven repository you linked to the jts-SNAPTHOT in your PR points to https://josm.openstreetmap.de/nexus/content/repositories/snapshots/org/openstreetmap/josm/plugins/jts/SNAPSHOT/
There I only see an older jts version from 2020, where the plugin version says 35458, whereas JOSM now has a jts with version 35893 with a build date in 2022. Could it be that the snapshot directory doesn't yet have the new JTS version?

Yep. The job probably failed (it did with geotools as well, but since I had to due a bugfix for geotools, geotools is fine now). I don't know how to force a retry without making modifications to the jar file, which I'm disinclined to do.

Another thing, in the geotools-wfs project, there are still all the older geotools 22.0 jar files in the lib folder. Should I replace those with the 26.1 versions which may be compiled against jst 1.18 instead of 1.16?

You should probably remove those and use the versions downloaded by maven.

All compiles OK, but still getting stuck on the getExteriorRing function in the jts when actually using the plugins...

Yeah. I kind of of need steps to reproduce to do anything else with it.

comment:18 by taylor.smock, 3 years ago

@Don-vip: Is there a good way to force an update to the JTS package in JOSM nexus? It looks like the updated dist didn't get picked up by the CI.

EDIT: See https://github.com/gidema/josm-geotools-wfs/pull/15#issuecomment-1039053147

Last edited 3 years ago by taylor.smock (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Don-vip.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.