#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)
Change History (20)
by , 3 years ago
Attachment: | 21670.patch added |
---|
by , 3 years ago
Attachment: | 21670.jts_update.patch added |
---|
comment:1 by , 3 years ago
Note: attachment:21670.jts_update.patch depends upon attachment:21670.patch.
comment:5 by , 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.
comment:7 by , 3 years ago
I've released conflation 0.6.9:
https://github.com/JOSM/conflation/releases/tag/v0.6.9
follow-up: 9 comment:8 by , 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!
comment:9 by , 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 , 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 , 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.
comment:12 by , 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.
follow-up: 14 comment:13 by , 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!
comment:14 by , 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 , 3 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
follow-up: 17 comment:16 by , 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...
comment:17 by , 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 , 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
Update JTS from 1.16.1 to 1.18.2. Potentially binary/source incompatible.