Ticket #4228 (new defect)
WFS 1.1.0 server and client axis order fixies
|Reported by:||jachym||Owned by:||sdlime|
|Component:||WFS Client||Version:||svn-trunk (development)|
According to all sources, WFS 1.1 server and client implementation has some issues, regarding axis order.
In the text I do assume, that "normal" axis order is "x,y", where "x", stands for "horizontal" and "y" for vertical. By "inverted axis order" I do mean, that coordinates pair is given in the form "y,x" (or lat,long for certain types of SRSs).
- MapServer WFS 1.1.0 client does not send BBOX coordinates in propper order (if needed) "miny,minx,maxy,maxx" for some SRSs.
- MapServer WFS 1.1.0 client does not append information about used BBOX CRS, like "....&BBOX=10,50,20,60,epsg:4326&...."
- MapServer WFS 1.1.0 client does not understand, that axis order of GML file send back from the server has inverted axis order
- MapServer WFS 1.1.0 server does not use layer's SRS, when no information about BBOX srs is given.
This patch fixes all above:
- It fixes the correct BBOX request form in maplayerwfs.c, so that if WFS 1.1.0 and SRS with inverted axis order is used, axis are inverted
- It also appends information about used SRS to end of the BBOX
- If WFS 1.1.0 and proper SRS, it configurates OGR, so it deals with data with inverted axis order
- If the server obtains WFS 1.1.0 request with BBOX parameter, which does NOT include information about BBOX's used SRS, it takes the layer's default.
- mapfile.h - added definition of msIsAxisInverted function.
- mapfile.c - changed definition of msIsAxisInverted, removed "static"
- mapwfslayer.c - BBOX in the GET request modified, so that axis are inverted when they should be and information about used SRS is appended to the BBOX
- mapwfslayer.c - Added OGR configuration options GML_INVERT_AXIS_ORDER_IF_LAT_LONG and GML_CONSIDER_EPSG_AS_URN when needed, so that the data are readable with MapServer
- mapwfs.c - default value of bbox SRS is set to layers's projection.
NOTE: msIsAxisInverted should IMHO be used all through MapServer instead of sometimes used pj_islatlong. That's why it's definition is added to the mapfile.h file
NOTE: It has been long time ago, since I touched any C-code. And even then, I never was really familiar with it. So please, review the patch, attached to this ticket.