GeoPackage WKB and contents min/max axis order issue

Description

The GeoServer Community Plugin GeoPackage produces flipped axis when created for data encoded in EPSG:4326. The plugin leverages code from GoeTools GeoPackage. That's why the issue targets GeoTools.

Axis ordering per GeoPackage standard
https://docs.ogc.org/is/12-128r17/12-128r17.html

Requirement 13, Table 4 defines the *_x to be EAST or LONGITUDE and *_y to be NORTH or LATITUDE
Issue min/max: GeoPackage contains LATITUDE/LONGITUDE

Requirement 19, Note alerts that WKB is using LON/LAT axis order. The GeoPackage standard leverages the OGC Policy directive () 'case four' - the legacy case - that informs that the WKB axis order to be followed. WKB as OGC 06-104r4 defines the axis order to be (x,y{,z}{,m}) where x is easting or longitude, y is northing or latitude, z is optional elevation.
Issue WKB: GeoPackage geometry encoded in WKB has LATITUDE/LONGITUDE

Verification
Download GeoPackage for Giant Polygon
https://ogc.secure-dimensions.com/geoserver-dp/tiger/ows?service=WFS&version=2.0.0&request=GetFeature&typeName=tiger%3Agiant_polygon&outputFormat=application%2Fx-gpkg

Issue WKB
giant_polygon.the_geom=47500002000010E6C0568000000000004056800000000000C066800000000000406680000000000000000000060000000100000000030000000100000005C056800000000000C0668000000000004056800000000000C06680000000000040568000000000004066800000000000C0568000000000004066800000000000C056800000000000C066800000000000
=> MULTIPOLYGON (((-90 -180, 90 -180, 90 180, -90 180, -90 -180)))

Issue min/max
gpkg_contents.min_x=-90.0
gpkg_contents.min_y=-180.0
gpkg_contents.max_x=90.0
gpkg_contents.mx_y=180.0

Environment

Issue independent from Environment

Activity

Fixed

Details

Assignee

Reporter

Triage

Fix versions

Affects versions

Priority

Created November 2, 2021 at 8:19 AM
Updated January 24, 2022 at 7:11 PM
Resolved January 24, 2022 at 7:11 PM