ThinkGeo.com    |     Documentation    |     Premium Support

WMS error with a specific URL

Hi
Usualy,I have no problem with WMS but with a URL, I have.

    public WmsOverlay LoadWMSscanIGN(string _cheminProjet, string _crs)
    {
        var dbcache = System.IO.Path.Combine(_cheminProjet, "Cachetiles.db");
        var wmsOverlay = new WmsOverlay();
        wmsOverlay.ServerUris.Add(new System.Uri("http://mapsref.brgm.fr/wxs/refcom-brgm/refign?"));
        wmsOverlay.Parameters.Add("LAYERS", "FXX_SCAN1000,FXX_SCANREG,FXX_SCAN100,FXX_SCAN25TOPO");
        wmsOverlay.Parameters.Add("SRS", _crs);//"EPSG:2154"
        wmsOverlay.Parameters.Add("FORMAT", "image/png");
        wmsOverlay.Parameters.Add("STYLES", "");
        wmsOverlay.Parameters.Add("VERSION", "1.3.0");
        wmsOverlay.Name = "IGN";
        wmsOverlay.TileCache = new SqliteBitmapTileCache(dbcache, "scanign");
        return wmsOverlay;
    }

On the screen, I have an error:
msWMSLoadGetMapParams:WMS server error:invalid format application/vnd…

I have not problem with QGIS or Mapinfo

Regards
Laurent M

Hi Laurent,

Our WMS overlay should set “excpetions” parameter as “application/vnd.ogc.se_inimage”.

Your error mentioned “invalid format application/vnd…”, so I think that’s should because it don’t support this type of exceptions, you can try to modify this parameter in SendingWebRequest event to modify this parameter.

Regards,

Don

Hi Don
It is an WmsOverlay
There is not SendingWebRequest event.

Regards

Hi Maumet,

Yes, WmsOverlay doesn’t contains SendingWebRequest event. Like Don mentioned before, this issue caused by the incorrect parameter. Please try change the Exceptions by the code below:

wmsOverlay.Parameters.Add("EXCEPTIONS", "XML");

There is another Exception formats provide by your server: XML,INIMAGE,BLANK.
We can get the meta for the server by view: http://mapsref.brgm.fr/wxs/refcom-brgm/refign?SERVICE=WMS&REQUEST=GetCapabilities

When we browse it in browser, we should get a XML document which includes requesting parameters, projection, layer, styles, etc. We should set the parameters based on it.

Following is the code snippets:

        wmsOverlay.ServerUris.Add(new System.Uri("http://mapsref.brgm.fr/wxs/refcom-brgm/refign?"));
        wmsOverlay.Parameters.Add("LAYERS", "FXX_SCAN1000,FXX_SCANREG,FXX_SCAN100,FXX_SCAN25TOPO");//CP.CadastralParcel
        wmsOverlay.Parameters.Add("CRS", "EPSG:4326");//Or EPSG:2154
        wmsOverlay.Parameters.Add("FORMAT", "image/png");
        wmsOverlay.Parameters.Add("STYLES", "default");
        wmsOverlay.Parameters.Add("VERSION", "1.3.0");
        wmsOverlay.Parameters.Add("EXCEPTIONS", "XML");

Hope it’s helped.

Thanks,
Peter

Hi Peter
It is ok with the EXCEPTIONS, but it is SRS, not CRS for projection ?

Thanks
Laurent

Hi Laurent,

As far as I know, CRS is used in 1.3 and SRS used in the older ones. But this is based on the WMS Server.

In android edition we’ll use CRS instead of SRS if the version is 1.3.

Thanks,
Peter