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

Reverse layer list in GetCapabilities if user agent is an ArcGIS client #6

Closed
manelclos opened this issue Nov 23, 2010 · 8 comments
Closed

Comments

@manelclos
Copy link
Member

When using the wms service in ArcMap, the layers will be requested top-down (first in xml is drawn last). Reversing the layer list in the GetCapabilities response could be a quick way of solving this.

'HTTP_USER_AGENT': 'ArcGIS Client Using WinInet'

@springmeyer
Copy link
Member

okay, sounds good!. Will this be the same for both Arc 9.1 -> Arc10 ?

@manelclos
Copy link
Member Author

Don't know. Will leave the bug open until tested.

@manelclos
Copy link
Member Author

Layer ordering was changed here:
http://bitbucket.org/springmeyer/ogcserver/changeset/072377ab0844

then fixed for GetMap here:
http://bitbucket.org/springmeyer/ogcserver/changeset/0525b648aab5

Reverting both changes fixes the problem. Is that ok or is there a reason for keeping layers orderer that way?

@springmeyer
Copy link
Member

The original change was made due to: http://trac.osgeo.org/qgis/ticket/2792. I've felt uncertain about it ever since and I've not had time to read the WMS spec enough to find out about how/whether layer ordering (from the order in GetCaps) is explicitly stated.

I find it hard to believe that the QGIS developers would be wrong here, but I also realize that this original change may have broken all clients except QGIS 1.5, which is not good (it would be a whole lot easier to catch the QGIS 1.5 user agent than all others). Hopefully there is a simple solution we are missing.

@manelclos
Copy link
Member Author

The WMS spec says nothing about layers order in GetCapabilities. Only some information is given for the GetMap request: "A WMS shall render the requested layers by drawing the leftmost in the list bottommost, the next one over that, and so on"

Mapserver maintains the mapfile order, see the example and the xml:
http://mapserver.org/tutorial/example1-5.html
http://demo.mapserver.org/cgi-bin/mapserv?map=/osgeo/mapserver/tutorial/htdocs/example1-5.map&service=WMS&request=GetCapabilities&version=1.1.1)

ArcGIS Server wms service outputs an inverted list compared to the mxd document, effectively sending bottommost layer first. When adding wms services (from ArcGIS server or any other source) Arcmap (9.3.1 tested) will invert the order of the GetCapabilities response to show first layer bottommost (as is usual in arcmap's point of view: last layer in list is drawn first).

About QGis, 1.4.0 works fine, 1.5.0 and 1.6.0 show an inverted order of the layers, thus needing your patch to work ok. The problem I see is that 1.6.0 sends an user agent header as "Mozilla/5.0".

I think reverting the changes and going the mapserver and arcgis way is the proper thing to do.

@manelclos
Copy link
Member Author

Tested GVSig 1.10 today. It does show GetCapabilities in xml order, but reverses the list when adding the layers. This is, it works the same way as ArcMap.

@springmeyer
Copy link
Member

okay, sounds good to revert then. I should follow through with QGIS folks on this...

I'm surprised QGIS reports "Mozilla/5.0" - are you sure?

After you revert and close we should create another ticket about catching QGIS >=1.5 user agent and flipping.

@manelclos
Copy link
Member Author

Commited.

This issue was closed.
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

No branches or pull requests

2 participants