After creating a Web Map Service (WMS) table, the map image might not display or might be in the wrong location and distorted due to the coordinate order in use by the server. Coordinate values are listed in the axis order as specified by the referenced coordinate reference system (CRS). However, not all servers follow the Open Geospatial Consortium (OGC) Web Map Service Interface Standard. As a result, coordinates for coordinate systems, such as latitude/longitude systems, may be in reverse order from what is expected when retrieving or saving map images with a WMS server. If after creating a WMS table, the map image does not display or is in the wrong location and distorted, then you may need to override the coordinate order.
The following sections describe how to apply a coordinate order override and correct the display of WMS map images:
- Applying a Coordinate Order Override to a WMS Table or Server
- Testing the Coordinate Order of a WMS Table
For more information about the Open Geospatial Consortium (OGC) and Web Map Service Interface Standard, see http://www.opengeospatial.org.
Applying a Coordinate Order Override to a WMS Table or Server
After creating a Web Map Service (WFS) table, the map image might not display or might be in the wrong location and distorted due to the coordinate order. If this occurs, you can use MapInfo Pro to override coordinate order at either the server or table level when working with WMS servers.
Server Override
If the coordinate order is incorrect for a WMS table retrieved from a server, then it may also be incorrect for other tables retrieved from that server. In this case, you can override the coordinate order at the server level.
You can make changes to the XML file in an XML editor, and then restart MapInfo Pro to apply the changes.
In the MIWMSServers.xml file, each server specification begins with a <Server> node. This node will have child nodes for the URL <HTTP> and a description <Description>. There may also be other child nodes as well. To override the coordinate order for a server, you will add a new child node <OverrideCoordinateOrder> with the value true.
For example:
<Server>
<HTTP>server URL</HTTP>
<Description>server description</Description>
<OverrideCoordinateOrder>true</OverrideCoordinateOrder>
</Server>
If you have a local copy of the table, download the table again to apply the coordinate order override. If you do not want to download the table again, you can use the Table Override described in the next section.
Table Override
If the coordinate order is incorrect for only some tables retrieved from a server, you can apply a coordinate order override at the table level instead of at the server level. When creating a WMS table you specify the name and location of the TAB file that contains some of the information about the table. Additional information is stored in an XML file with the same name and located in the same folder. You will need to edit this xml file.
The XML file for the WMS table has a <SRS> node with a value of the coordinate system code for the table. To override the coordinate order for the table, you must add an OverrideCoordinateOrder attribute with a value of true to this node.
For example:
<SRS OverrideCoordinateOrder="true">EPSG:4326</SRS>
To have the coordinate override take effect after changing and saving the XML file, close and re-open the WMS table.
Testing the Coordinate Order of a WMS Table
You can check a WMS table to see if the data is in the correct coordinate order using the MapBasic TableInfo function. This function includes an attribute called TAB_INFO_OVERRIDE_COORDINATE_ORDER (43) that returns TRUE when the table is a WFS or WMS table with the coordinate order override turned on. This command can be issued via the MapBasic window or can be included in a MapBasic application.
The syntax is:
TableInfo(MyWMSTable, TAB_INFO_OVERRIDE_COORDINATE_ORDER)
Where MyWMSTable is the name of the table you are checking the coordinate order for.