ptv-logistics / xserver.net

Source code for PTV xServer.NET
https://xserverinternet.azurewebsites.net/xserver.net/
MIT License
2 stars 2 forks source link

WMS server with swapped North and East axis #19

Open MFinkBK opened 1 year ago

MFinkBK commented 1 year ago

I'm currently trying to implement displaying single image WMS layers, and some GIS servers seem to have the X and Y axis swapped. This results in the WMS layer not displayed or displayed at the wrong location. I think the issue can be fixed with a modified bounding box where X and Y coordinates are swapped. One example WMS service: https://geodatenonline.bayern.de/geodatenonline/seiten/wms_fzw

I know that the official WMS specification says that bbox=minX,minY,maxX,maxY, and the WmsMapService class does this correctly. But would there be a possibility to also support those WMS services with swapped axes?

On a side note, in OpenLayers on the JavaScript side, I can support those WMS servers by creating a Projection from EPSG:4326, but with a different axisOrientation ("neu" instead of "enu").

oliverheilig commented 1 year ago

I think you are referring the y-axis orientation in WMS 1.1 vs 1.3. There's also a handling in leaflet

MFinkBK commented 1 year ago

Yes, and here's the handling in OpenLayers, although this one is more flexible:

https://github.com/openlayers/openlayers/blob/58fbe6f122cf9e77d11e9587a9f075a06645d412/src/ol/source/wms.js#L52-L56

Would it be possible to also implement something in the WmsLayer and WmsMapService, e.g. a SwapAxisOrientation boolean flag?

oliverheilig commented 1 year ago

Sorry for the late response. I understand your point, but currently i have no time to work on the project. At the moment the only thing i could is to review a pull request. :smirk:

MFinkBK commented 1 year ago

No problem, I'll prepare a pull request, but it may also take a while from my side.