Hi,
I tested wmtslayer and I have an error with a message “The input string format is incorrect”.
I change decimal separator in the configuration panel and I have the same result.
The wmts service comes from IGN organism
Extract of the code :
private void serviceWMTS_Loaded(object sender, RoutedEventArgs e)
{
map.MapUnit = GeographyUnit.Meter;
var wmsLayer = new WmtsLayer();
wmsLayer.ServerUris.Add(new Uri(“wxs.ign.fr/clé/geoportail/wmts”));
wmsLayer.SendingWebRequest += new System.EventHandler<SendingWebRequestEventArgs>(binglayer_SendingWebRequest);
try
{
wmsLayer.Parameters.Add(“layers”, “ORTHOIMAGERY.ORTHOPHOTOS”);
wmsLayer.Parameters.Add(“crs”, “EPSG:3857”);
wmsLayer.Parameters.Add(“format”, “image/png”);
wmsLayer.Parameters.Add(“style”, “Default”);
wmsLayer.Parameters.Add(“maxHeight”, “256”);
wmsLayer.Parameters.Add(“maxWidth”, “256”);
//wmsLayer.ActiveLayerName = “ORTHOIMAGERY.ORTHOPHOTOS”;
wmsLayer.Parameters.Add(“id”, “xxxx”);
wmsLayer.Parameters.Add(“password”, “xxxx”);
wmsLayer.Open();
}
catch (Exception ee)
{
MessageBox.Show(ee.Message);
}
var server = wmsLayer.GetServerLayerNames();
var ov = new LayerOverlay();
ov.Layers.Add(wmsLayer);
map.Overlays.Add(“Test”, ov);
map.CurrentExtent = wmsLayer.GetBoundingBox();
map.Refresh();
}
The code error :
Interception de System.FormatException
HResult=-2146233033
Message=Le format de la chaîne d’entrée est incorrect.
Source=mscorlib
StackTrace:
à System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
à System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
à System.Convert.ToInt32(String value)
à ThinkGeo.MapSuite.Core.WmtsLayer.qHU=(XmlNode qXU=, XmlNamespaceManager qnU=)
à ThinkGeo.MapSuite.Core.WmtsLayer.CzU=(XmlElement pnU=, XmlNamespaceManager p3U=)
à ThinkGeo.MapSuite.Core.WmtsLayer.pXU=()
à ThinkGeo.MapSuite.Core.WmtsLayer.OpenCore()
à ThinkGeo.MapSuite.Core.Layer.Open()
à Carto_WMS.MainWindow.serviceWMTS_Loaded(Object sender, RoutedEventArgs e) dans c:\Steph_DevEnCours\Carto_WMS\Carto_WMS\MainWindow.xaml.cs:ligne 249
InnerException:
Have you ever encountered this problem ?
I tested the wmts service with the software Qgis and I don’t have any problem (ie Capture_WMTS_PASOK.jpg)
Thanks for your help.
Regards.
Steph.
Capture_WMTS_PASOK.JPG (57.9 KB)
WMTS layer problem
Hi Steph,
Sorry we are unable to get the capabilities.xml from wxs.ign.fr/clé/geoportail/wmts?Service=WMTS&Request=GetCapabilities as we don’t have the id and password. Could you please attach the capabilities.xml here.
We did some tests and found that the WmtsLayer doesn’t support the CRS(IGNF:WGS84G) currently, but I’m not sure if this is the issue on you side.
Thanks,
Peter