Hi,
I try to test wmtslayer; WmtsTiledOverlay; WmtsTileMatrix.
I would like to access a WMST Service (raster) that should I use (or wmtstiledOverlay wmtsLayer?
And wmtsTileMAtrix create an image pyramid ?
Thanks.
Regards.
Steph.
WMTS : wmtsTiledOverlay ; WmtsLayer ; WmtsTileMatrix
Hi Steph,
Thank you for your post, both of two way are supported. Wmts mechanism is basing on image pyramid. You can access your wmts server to getting these pyramid information, if you can’t access your wmts server link, you can send the server link to us, and we will make some test for you.
Thanks
Summer
Hi Summer,
Thanks for your answer, i did some progress since my last post.
I have a response 200 with fiddler … but I have an error message when I try to open the layer.
The code is :
private void wpfMap1_Loaded(object sender, RoutedEventArgs e)
{
wpfMap1.MapUnit = GeographyUnit.DecimalDegree;
List<Uri> u2 = new List<Uri>() { new Uri(“wxs.ign.fr/myKey/geoportail/wmts”) };
WmtsLayer wmtsLayer = new WmtsLayer(u2);
wmtsLayer.WebProxy = proxyObject;
wmtsLayer.Parameters.Add(“LAYER”, “ORTHOIMAGERY.ORTHOPHOTOS&”);
wmtsLayer.Parameters.Add(“EXCEPTIONS”, “text/xml&”);
wmtsLayer.Parameters.Add(“FORMAT”, “image/jpeg&”);
wmtsLayer.TileMatrixSetName = “PM&”;
wmtsLayer.Parameters.Add(“TILEMATRIX”, “18&”);
wmtsLayer.Parameters.Add(“TILEROW”, “90241&”);
wmtsLayer.Parameters.Add(“TILECOL”, “132877&”);
wmtsLayer.ActiveLayerName = “ORTHOIMAGERY.ORTHOPHOTOS”;
wmtsLayer.SendingWebRequest += new EventHandler<SendingWebRequestEventArgs>(wmtsLayer_SendingWebRequest);
try
{
wmtsLayer.Open();
}
catch (Exception ee)
{
MessageBox.Show(ee.Message);
}
wmtsLayer.GetBoundingBox();
…
}
internal void wmtsLayer_SendingWebRequest(object sender, SendingWebRequestEventArgs e)
{
NetworkCredential nn = new NetworkCredential(login, password);
e.WebRequest.Credentials = nn;
}
The error message is
Interception de System.IndexOutOfRangeException
Message=L’index se trouve en dehors des limites du tableau.
Source=MapSuiteCore
StackTrace:
à ThinkGeo.MapSuite.Core.WmtsLayer.qGE=(XmlNode qWE=, XmlNamespaceManager qmE=)
à ThinkGeo.MapSuite.Core.WmtsLayer.x0A=(XmlElement pmE=, XmlNamespaceManager p2E=)
à ThinkGeo.MapSuite.Core.WmtsLayer.pWE=()
à ThinkGeo.MapSuite.Core.WmtsLayer.OpenCore()
à ThinkGeo.MapSuite.Core.Layer.Open()
à ThinkGeoWPFGoogleMap.WMTS_Layer.wpfMap1_Loaded(Object sender, RoutedEventArgs e) dans C:\Steph_WPFCarto\ThinkGeoWPFGoogleMap\ThinkGeoWPFGoogleMap\WMTS_Layer.xaml.cs:ligne 134
InnerException:
My questions are :
1) Have you ever met this kind of error ?
2) What is wmtsLayer.TileMatrixSetName ? What name should I put for TileMatrixSetName ? Should I use WmtsTileMatrix for this ?
3) Should I use all these parameters ? or not ?
Thanks for your help.
Regards.
Steph.
Hi Steph,
I haven’t met this kind of error, I think you can get the xml data file, and track this xml data file, you maybe find error position. Do you mind send the wmts server information to me, I can make some test on it. There is a simple sample wiki.thinkgeo.com/wiki/File:Source_Code_ServicesEditionSample_WmtsLayer_CS_121116.zip.
WmtsLayer.TileMatrixSetName indicates a collection name on a layer of wmts server, there are several collections in a layer, they are distinguished with “projection”, “quad”, “scale”, “compatible” etc. You can use following statements to get these names:
wmtsLayer.Open();
Collection<string> tileMatrixSetNames = wmtsLayer.GetServerTileMatrixSetNames();
Wmts tile matrices will be classified into these names. Yes, you will use this on WmtsTileMatrix.
I think following properties are required as above sample:
WmtsSeverEncodingType
ServerUris
ActiveLayerName
ActiveStyleName
TileMatrixSetName
OutputFormat
Best Regards
Summer
Hi Summer,
I tested the sample wiki.thinkgeo.com/wiki/File:Source_Code_ServicesEditionSample_WmtsLayer_CS_121116.zip. which is a winform sample,
so I created a wpf project and I took the code :
private void wpfMap1_Loaded(object sender, RoutedEventArgs e)
{
WmtsLayer wmtsLayer = new WmtsLayer();
wmtsLayer.DrawingExceptionMode = DrawingExceptionMode.DrawException;
wmtsLayer.WmtsSeverEncodingType = WmtsSeverEncodingType.Restful;
wmtsLayer.ServerUris.Add(new Uri(“server.caris.com/spatialfusionserver/services/ows/wmts/NaturalEarth/”));
WmtsLayer wmtsLayerOpenGeo = new WmtsLayer();
wmtsLayerOpenGeo.DrawingExceptionMode = DrawingExceptionMode.DrawException;
wmtsLayerOpenGeo.ServerUris.Add(new Uri(“v2.suite.opengeo.org/geoserver/gwc/service/wmts/”));
try
{
wmtsLayerOpenGeo.Open();
wmtsLayerOpenGeo.ActiveLayerName = “medford:buildings”;
wmtsLayerOpenGeo.ActiveStyleName = “_null”;
wmtsLayerOpenGeo.TileMatrixSetName = “EPSG:900913”;
wmtsLayerOpenGeo.OutputFormat = “image/png”;
wmtsLayer.Open();
wmtsLayer.ActiveLayerName = “newworld”;
wmtsLayer.ActiveStyleName = “default”;
wmtsLayer.TileMatrixSetName = “GoogleMapsCompatible”;
wmtsLayer.OutputFormat = “image/png”;
}
catch (Exception ee)
{
MessageBox.Show(ee.Message);
}
I have the same error message as my example WMTS :
Interception de System.IndexOutOfRangeException
Message=L’index se trouve en dehors des limites du tableau.
Source=MapSuiteCore
StackTrace:
à ThinkGeo.MapSuite.Core.WmtsLayer.qGE=(XmlNode qWE=, XmlNamespaceManager qmE=)
à ThinkGeo.MapSuite.Core.WmtsLayer.x0A=(XmlElement pmE=, XmlNamespaceManager p2E=)
à ThinkGeo.MapSuite.Core.WmtsLayer.pWE=()
à ThinkGeo.MapSuite.Core.WmtsLayer.OpenCore()
à ThinkGeo.MapSuite.Core.Layer.Open()
à ThinkGeoWPFGoogleMap.WMTS_Layer_Bis.wpfMap1_Loaded(Object sender, RoutedEventArgs e) dans C:\Steph_WPFCarto\ThinkGeoWPFGoogleMap\ThinkGeoWPFGoogleMap\WMTS_Layer_Bis.xaml.cs:ligne 43
InnerException:
The error occurs when opening the layer => wmtsLayer.Open() or wmtsLayerOpenGeo.Open();
Have you the same problem ?
The dll version that I use is 7.0.0.245
Thanks .
Regards.
Steph.
Hi Steph,
Thanks for your further info, I fixed a wmts matrix tile issue and make a simple wmts layer sample for you, you can download the latest version 7.0.290.0(still in build will be available in hours) or later and run this sample, you can see the sample is work well (attachment: WmtsLayerSample.zip).
Thanks,
Summer
WmtsLayerSample.zip (127 KB)