.net SDK WmsLayer Performance

108
4
06-26-2020 01:27 AM
AndreasStolpmann
New Contributor

Hallo,

i'm a litte confused about how to correctly use a WmsLayer (Esri.ArcGISRuntime.WPF 100.8.0). I have the following, working code:

var layer = new WmsLayer(new Uri("http://<local.geoserver>:8080/geoserver/osm/wms"), new[] { "osm_world" });
await layer.LoadAsync();
var map = new Map();
map.OperationalLayers.Add(layer);
MyMapView.Map = map;

This works fine and shows me a map. BUT everytime the map is moved arcgis is requesting an image of the size of the current map.

GET /geoserver/osm/ows?SERVICE=WMS&EXCEPTIONS=XML&bbox=-36.59692273440173%2C-18.368541923134622%2C75.217619033179091%2C40.24852015145175&bgcolor=0xFEFFFF&crs=CRS%3A84&format=image%2Fpng&height=411&layers=osm_world&request=GetMap&service=WMS&styles=&transparent=TRUE&version=1.3.0&width=784 HTTP/1.1

This results in super long loading times and unnecessary traffic. I would expect it to download and CACHE multiple smaller images (like 256x256) and use them to build the whole image.

This is exactly what happens if i use leafletjs in a web app and the performance is way better.

How can i configure arcgis to work like this?

Thanks you

Andreas

Tags (3)
0 Kudos
4 Replies
dotMorten_esri
Esri Frequent Contributor

This is generally how dynamic layers work in the runtime. If you want to use a tiled version, use a WMTS service with the WmtsLayer.

0 Kudos
MichaelBranscomb
Esri Frequent Contributor

Hi,

Are you using exactly the same URL in both cases?

Note I'm speculating here... but we've found performance differences when working with Geoserver depending on the type of URL pattern you use for WMTS... and this Geoserver doc implies it may also apply to WMS : HTTP Response Headers — GeoServer 2.17.x User Manual. You can use Fiddler to check the response. It's possible you're seeing one image pulled from the cache and another image dynamically rendered by the server. For WMTS we found when you add the workspace name in the URL it appears GeoServer makes a request to load/render the layer from the datasource/workspace rather than pulling from cached images.

Thanks

Mike

0 Kudos
AndreasStolpmann
New Contributor

Hey, thanks for the reply!

Are you using exactly the same URL in both cases?

Yes i'm sure. "http://<local.geoserver>:8080/geoserver/osm/wms" in both cases.

The requests by leaflet look like this:

GET /geoserver/osm/wms?&service=WMS&request=GetMap&layers=osm_world&styles=&format=image%2Fjpeg&transparent=false&version=1.1.1&id=osm_world&style=&width=256&height=256&srs=EPSG%3A4326&bbox=45,28.125,50.625,33.75 HTTP/1.1

They also use "width=256&height=256" which is exactly what i would expect Arcgis to do too.

Also I'm not talking about caching on the server side. I'm talking about the client side. I would expect Arcgis to download 256x256 Images, save them, and reuse them instead of downloading an 8 MB image every time the map is moved a tiny bit.

Maybe i'm just using this completely wrong but i really would expect there to be such an option.

Regarding WMTS:  I'm trying to get that working but couldn't get a map to show yet.

Thanks

Andreas

0 Kudos
AndreasStolpmann
New Contributor

Okay, i got it running using WMTS and it seems like it does what i want. Still i'm not sure why arcgis is using wms like it does.

0 Kudos