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

Print: Determine topLeft axis order by supportedCRS of TileMatrixSet #920

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

jampukka
Copy link
Member

@jampukka jampukka commented Feb 8, 2023

Currently the axis order of topLeft is assumed to always be x,y (it's even returned to oskari-frontend as {"lon": [0], "lat": [1]} by GetLayerCapabilities action) but WMTS spec states that The order of these axes, shall be as specified by the supportedCRS. This leads to wrong tileRow/tileCol calculations in service-print.

For frontend OL does the swapping for us:
https://github.com/oskariorg/oskari-frontend/blob/2.9.1/bundles/mapping/mapwmts/service/WmtsLayerService.ol.js#L189
https://github.com/openlayers/openlayers/blob/v7.0.0/src/ol/source/WMTS.js#L455
https://github.com/openlayers/openlayers/blob/v7.0.0/src/ol/source/WMTS.js#L484-L486
so fixing this "more deeply" would cause issues.

Obviously messing with axis order is always risky for backwards compatibility. However, printouts should reflect what's shown on users screen, so print service mimicking what OL is doing seems like the way to go.

Here's a sample printout from Oskari installation with the fix applied running EPSG:3879 (GK25FIN, NE axis order) with WMTS (aerial image, in EPSG:3879 tilematrixset) + WMS (red boundary) + feature layer (yellowish semi-transparent rectangles) .
wmts_axis_order

@ZakarFin ZakarFin added this to the 2.10.0 milestone Feb 9, 2023
@ZakarFin ZakarFin merged commit af8e2f4 into oskariorg:develop Feb 9, 2023
@jampukka jampukka deleted the feature/print-wmts-axis-order branch February 9, 2023 13:09
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.

2 participants