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

Geotools v21.4 upgrade #3886

Closed
wants to merge 11 commits into from
Closed

Geotools v21.4 upgrade #3886

wants to merge 11 commits into from

Conversation

juanluisrp
Copy link
Contributor

@juanluisrp juanluisrp commented Jun 25, 2019

This pull request supersedes #3881 including its changes.

Félix Serrano Blanco and others added 10 commits October 25, 2018 14:12
Updated geotools dependencies from 16.0 to 20.0 version. Artifacts affected: gt-api, gt-brewer, gt-cql, gt-epsg-extension, gt-epsg-hsql, gt-geojson, gt-main, gt-referencing, gt-shapefile, gt-wms, gt-xml, gt-jdbc-db2, gt-jdbc-h2, gt-jdbc-mysql, gt-jdbc-oracle, gt-jdbc-postgis, gt-jdbc-sqlserver, gt-xsd-filter and gt-xsd-gml3.

Preserved an artifact as a legacy: gt-wfs. Updated artifact from 16.0 to 16.5 version.
Update Geotoosl to v20.4 and replace legacy `gt-wfs` dependency left behind in PR #3198.
Now using the new `gt-wfs-ng` one which is available in geotoos v20.4.
Replace 'org.geotools.factory.GeoTools' by `org.geotools.util.factory.GeoTools`
Replace `org.geotools.factory.Hints` by `org.geotools.util.factory.Hints`
Upgrade Geotools to v21.4. Rename/add/remove dependencies and rename
imports.
Use the right URL prefix in the tests.
Remote INSPIRE service sometimes doesn't answer because it has a limit of
concurrent users.
@juanluisrp juanluisrp added this to the 3.8.0 milestone Jun 25, 2019
@juanluisrp juanluisrp changed the title Geotools v21.0 upgrade Geotools v21.4 upgrade Jun 25, 2019
@juanluisrp
Copy link
Contributor Author

It seems there are some problems related with Mapfish print library that still depens on gt-render v 8.6:

Caused by: java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    org/fao/geonet/services/region/ThesaurusBasedRegionsDAO.getGeom(Ljeeves/server/context/ServiceContext;Ljava/lang/String;ZLorg/opengis/referencing/crs/CoordinateReferenceSystem;)Lorg/locationtech/jts/geom/Geometry; @32: invokevirtual
  Reason:
    Type 'org/geotools/geometry/jts/ReferencedEnvelope' (current frame, stack[1]) is not assignable to 'org/locationtech/jts/geom/Envelope'
  Current Frame:
    bci: @32
    flags: { }
    locals: { 'org/fao/geonet/services/region/ThesaurusBasedRegionsDAO', 'jeeves/server/context/ServiceContext', 'java/lang/String', integer, 'org/opengis/referencing/crs/CoordinateReferenceSystem', 'org/fao/geonet/kernel/region/Region' }
    stack: { 'org/locationtech/jts/geom/GeometryFactory', 'org/geotools/geometry/jts/ReferencedEnvelope' }
  Bytecode:
    0x0000000: 2a2b b600 202c b600 21b6 0022 3a05 1905
    0x0000010: c700 0501 b02a b400 0919 0519 04b6 0023
    0x0000020: b600 243a 0619 0619 05b6 0025 b600 26b6
    0x0000030: 0027 1906 b0
  Stackmap Table:
    append_frame(@21,Object[#120])

The method causing launching the error is

@Override
public Geometry getGeom(ServiceContext context, String id, boolean simplified, CoordinateReferenceSystem projection) throws Exception {
Region region = createSearchRequest(context).id(id).get();
if (region == null) {
return null;
}
Geometry geometry = factory.toGeometry(region.getBBox(projection));
geometry.setUserData(region.getBBox().getCoordinateReferenceSystem());
return geometry;
}

Analyzing the dependencies we can find org.geotools:gt-render:8.6 in the mapfish print-lib dependency tree

Mapfish prit-lib is using an old version of Geotools (v8.6). This is conflicting in
runtime with Geotools v21.1 so we are excluding the old one. After testing
Copy link
Member

@fxprunayre fxprunayre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing with @juanluisrp it looks like we have a wrong x/y order during WFS harvesting. Needs more test (tested with https://demo.geo-solutions.it/geoserver/web/).

@fxprunayre
Copy link
Member

@juanluisrp, I tested quite some of the examples from https://docs.geotools.org/latest/userguide/library/referencing/order.html with no luck. If you can have a look that would be great.

@jodygarnett jodygarnett mentioned this pull request Jul 12, 2019
2 tasks
@jodygarnett
Copy link
Contributor

Update, I have been performing some tests against gt-wfs-ng and geoserver 2.15.2, see the resulting table here geotools/geotools#2492

TLDR:

  • gt-wfs-ng does a better job of respecting what we ask for, previous implementation went to a lot of trouble to try and return in x/y order.
  • even with the datastore respects what we ask for the service on the other end can be configured wrong or implemented poorly!
  • general advise is to use WFS 1.1.0 and the "WFSDataStoreFactory:AXIS_ORDER" and "WFSDataStoreFactory:AXIS_ORDER_FILTER" connection parameters to account for differences between WFS implementations

@juanluisrp juanluisrp modified the milestones: 3.8.3, 3.8.4 Feb 13, 2020
@fxprunayre
Copy link
Member

Replaced by #4488

@fxprunayre fxprunayre closed this Mar 25, 2020
@fxprunayre fxprunayre deleted the geotools-21-upgrade branch August 19, 2020 07:49
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

Successfully merging this pull request may close these issues.

3 participants