ThinkGeo.com    |     Documentation    |     Premium Support

Displaying WMS with better Quality

Hi all,
I like to increase the display quality of WMS.
The WMS is displayed in a bad quality. Lines are not straight more like stairs.

How to increase the quality?

Regards
Hardy

Hi Hardy,

Thanks to let us know your question.

I want to make sure whether you found the quality reduce than earlier version or you think current render result is not good enough.

Have you tried to set this property and see whether it’s different:
layerOverlay.DrawingQuality = DrawingQuality.HighQuality;

I also want to know your detail package version and whether you view the map in a high resolution monitor.

Regards,

Ethan

Hi Ethan,

I think the quality is not good enough.
And there is not property “DrawingQuality”. I’m using WmsRasterLayer as Layer Type.
Version 11/beta018. WinForms.

Just tried to set up DrawingQuality at Map-Object. But that does not effect anything…

Regards
Hardy

Hi Hardy,

Thanks for your information.

I tested our sample here: https://github.com/ThinkGeo/DisplayWmsRasterLayerSample-ForWinForms

The result looks well with the lastest package.

I am not sure whether that’s related with the WMS provider but by our test server the map render result looks just the same like we request the tile image via browser, if possible could you please let’s know the WMS server so we can test to see where is the problem?

Regards,

Ethan

Hi Ethan,

I tested your WMS and yes this one is look ok. But display is done with scales around 1:100000 and above.
We are using scales 1:50 …In that area also WMS is getting stairs.
Zwischenablage01
In my example you can see the “Stairs”.
The base is vector geometry stored with PostGIS.
The WMS is setup using MapServer. Viewing with QGIS the quality is like vector geometry.
Viewing MapSuite we are getting “bad” results. When printing the quality is ok.
So it seems to me a problem with map display / canvas problem.

Any idea?

Regards
Hardy

Hi Hardy,

I hadn’t watched that when zoom into our server because it’s too simple. So I found a public free wms server for test: http://ows.terrestris.de/osm/service

I am not sure whether it’s the same behavior like your server

But it looks the stairs in line for this server is from server side:
https://ows.terrestris.de/osm/service?REQUEST=GetMap&BBOX=-94.5776778459549,39.0948137640953,-94.5736008882523,39.0976944565773&WIDTH=760&HEIGHT=537&LAYERS=OSM-WMS&STYLES=default&FORMAT=image/png&SRS=EPSG:4326&VERSION=1.1.1&SERVICE=WMS&EXCEPTIONS=

So I think a WMS server which can reproduce the issue should be helpful.

Or you can try to override the WmsRasterLayer for example:

   public class highQualityWMSLayer : WmsRasterLayer
  {
     public highQualityWMSLayer(Uri uri) : base(uri)
     { }

    protected override void DrawCore(GeoCanvas canvas, Collection<SimpleCandidate> labelsInAllLayers)
    {
        PlatformGeoCanvas tempCanvas = canvas as PlatformGeoCanvas;

        tempCanvas.DrawingQuality = DrawingQuality.HighQuality;
        tempCanvas.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
        tempCanvas.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;

        base.DrawCore(tempCanvas, labelsInAllLayers);
    }
}

I hope it’s helpful.

Regards,

Ethan