Skip to content

Trim the GeoTools footprint: GeoTools only in proj-gt, unused jars excluded - #251

Draft
jampukka wants to merge 3 commits into
nlsfi:mainfrom
jampukka:gpkg-wkt-via-proj
Draft

jampukka wants to merge 3 commits into
nlsfi:mainfrom
jampukka:gpkg-wkt-via-proj

Conversation

@jampukka

Copy link
Copy Markdown
Collaborator

GeoTools was pulled in twice: by hakunapi-proj-gt for reprojection and by hakunapi-gpkg for a single CRS.decode(...).toWKT(). With gpkg depending on it directly, excluding GeoTools' unused transitive jars from proj-gt alone would not have removed them from the WAR.

Breaking changes:

  • ProjectionTransformerFactory.getWKT(int srid, boolean longitudeFirst)
    • New required method: WKT 1 definition of a CRS the factory can transform
    • longitudeFirst forces x/y axis order
    • GPKGSpatialRefSystems asks the collection's factory with longitudeFirst = true
      *GeoPackage geometries are always x/y
    • hakunapi-gpkg no longer depends on GeoTools
    • JHeProjectionTransformerFactory (community) throws for now (have to fix that...)
  • gt-epsg-hsql exclusions in hakunapi-proj-gt
    • OWS/xlink/EMF (ISO citation metadata), ImageN (raster parameters) and commons-lang3 (URN_Parser, PROJFormatter, DefaultEntityResolver) are referenced only from GeoTools code paths hakunapi does not use: it decodes EPSG:<int> codes, transforms, and calls toWKT().

Behaviour changes:

  • Custom ProjectionTransformerFactory implementations must implement getWKT
    • To discuss: Make the new method default impl to throw, that way nothing breaks for anyone except if you're using custom ProjectionTransformerFactory and using GPKG outputformat
  • Seven jars (~4 MB) no longer arrive via hakunapi-proj-gt; an application relying on them transitively must declare them. Additionally, commons-lang3 also leaves the WAR once swagger-core's exclusions (Drop swagger-core's transitive dependencies from the servlet module #250) and these both are in
  • hakunapi-tiles-generator (community) takes the CRS definition from the seeded collections' factory and bundles hakunapi-proj-gt at runtime
  • GPKGSpatialRefSystems cache is a ConcurrentHashMap (was a HashMap mutated from concurrent requests)

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.

1 participant