ThinkGeo.com    |     Documentation    |     Premium Support

InMemoryBitmapTileCache "WMS SERVER: Not Aligned with TileMatrix"

Hi,

When used InMemoryBitmapTileCache with ShapeFileFeatureLayer (@“Content\Countries02.shp”) using WebMercator projection, WMS Server is unable to use the cache. Output window is showing “WMS SERVER: Not Aligned with TileMatrix” message. Is there a way to fix this?

Thank you
Uday

Hi Uday,

I think the Countries02.shp should work under 4326, if you want to use that under 900913, you should want to user our ManagedProj4Projection to reprojection it.

You can view our HowDoISamples to know how to use that, or you can paste your code here so we can see where is the problem.

Regards,

Don

Hi Don,

Thank you for a quick reply. We are following the your sample as is, we just added “InMemoryBitMapTileCache” to the MapConfiguration.TileCache. Please see following code :

protected override ThinkGeo.MapSuite.WmsServerEdition.MapConfiguration GetMapConfigurationCore(string style, string crs)
    {
        MapConfiguration mapConfiguration = new MapConfiguration();

        BackgroundLayer backgroundLayer = new BackgroundLayer(new GeoSolidBrush(GeoColor.SimpleColors.White));
        mapConfiguration.Layers.Add("Background", backgroundLayer);

        string worldLayerFilePath = @"Content\Countries02.shp";
        worldLayerFilePath = System.IO.Path.Combine(this.AssemblyDirectory, worldLayerFilePath);

        // Create the world layer from a shapefile and add a style to it
        ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(worldLayerFilePath);
        worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;
        worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

        switch (crs)
        {
            case SrsSphereMercator:
				Proj4Projection proj4 = new Proj4Projection();
				proj4.InternalProjectionParametersString = Proj4Projection.GetDecimalDegreesParametersString();
				proj4.ExternalProjectionParametersString = Proj4Projection.GetSphericalMercatorParametersString();
                worldLayer.FeatureSource.Projection = proj4;
                break;
        }

        // Create a MapConfiguration and add the layer to it
        mapConfiguration.Layers.Add("WorldLayer", worldLayer);
        mapConfiguration.TileCache = new InMemoryBitmapTileCache();
        return mapConfiguration;
    }

Please let us know is there any issue with above code.

And if you can point me to Esri ArcGIS javascript example for accessing this WMS Layer, would be really helpful.

Thank you,
Uday

Hi Uday,

It looks you forget to set correct projection and bounding box, please see my attached code which based on yours, it works well for me.

DisplayASimpleMapWmsLayerPlugin.cs (4.8 KB)

For your the other question “Esri ArcGIS JavaScript example for accessing this WMS Layer”, I am not really understand your requirement here, do you means you have a client end which is built by the “Esri ArcGIS JavaScript” and the server side is our WMS Server Edition? If so I think we should don’t have related sample.

Just like you seen, in our sample project the client side is using OpenLayers library, it of course also support the other library but because each library is very different, so we hadn’t built more sample based on other library.

Maybe you can try our WebAPI edition, which is based on REST service and may that can make you works easier. Or if you want to get our help on other client side library, you can contact our sales for professional service.

Wish that’s helpful.

Regards,

Don

Hi Don,

Thank you for the answer and sample. Seems like the same code is not working at our side for “EPSG:900913” projection. On server side we are still seeing following messages (appears not using the “InMemoryBitmapTileCache”)

WMS SERVER: Not Aligned with TileMatrix
WMS SERVER: Not Aligned with TileMatrix
WMS SERVER: Not Aligned with TileMatrix
WMS SERVER: Not Aligned with TileMatrix

Is this something to do with the TileMatrix of InMemoryBitmapTileCache, do we need to create new “MapSuiteTileMatrix” with different extent and scale? please let us know.

Thank you,
Uday

Hi Uday,

I don’t think you need to create new “MapSuiteTileMatrix” because the code I sent works well in my end. If you add any custom code please let me know.

Please upload your dll to the latest version from our product center, and I think you can try to close all the cache then to see whether this works.

Regards,

Don

Hi Don,

We followed your instructions as is, but still we are seeing lot of performance problem rendering the base map with "EPSG:900913"projection. Probably due to not using the caching, we still see lot of following messages in our “output” window.

WMS SERVER: Not Aligned with TileMatrix
WMS SERVER: Not Aligned with TileMatrix
WMS SERVER: Not Aligned with TileMatrix

We are attaching the files and DLL’s we are using with this post. Can you please check and let us know what might be the problem.

Thank you,
Uday
DisplayASimpleMapWmsLayerPlugin.zip (1.5 MB)

Hi Uday,

It looks your DisplayASimpleMapWmsLayerPlugin.cs just totally the same like I pasted.

And the dll you are using is 9.0.685.0.

So I think that’s maybe caused by other code in your application.

Please do a test like this for make sure that:

Download our HowDoISamples here: http://wiki.thinkgeo.com/wiki/map_suite_wms_server_edition_all_samples
Replace the dll with the latest version, then see whether that works.

If that works, replace the render logic with yours.

If that still works which means the code is caused by some other part of your project, you can compare that and find where is the different.

If the HowDoISample cannot works in your machine, please provide us more information about that, include a video which shows how to reproduce it and how the exception looks like, your OS, your .net version, your IDE etc.

Regards,

Don

Hi Don,
Am using VS IDE 2013, .NET version 4.0, OS : windows 10

Have recorded some screen capture, can you please check it.

Video is too big to upload. Please check here https://drive.google.com/file/d/0B8kDtY7OecGgOU95WTI4SDFrU2c/view?usp=sharing

Thank you,
Uday

Hi Uday,

Thanks for your video, we double check that, that’s only a trace message which is used for debug.

We have fixed that and please get 9.0.695.0 or higher version from our product center.

Regards,

Don

Hi Don,

Thank you for the reply. We couldn’t find 9.0.695.0 or higher in our download page.

The max version available now is WmsServerEditionFull9.0.694.0DllPackage.zip. Do we need to contact sales for this availability?

And regarding the message; might be trace message, but there is definitely lot of performance difference when cache is used with projection EPSG:4326 and EPSG:900913. We believe for “EPSG:900913” definitely it is not using the cache that is the reason it is painting every time and it is very very slow. We believe this should be addressed in above said “9.0.695.0” or higher version. Please let us know how to download latest version and we will update our solutions to check this problem and let you know.

Thank you,
Uday

Hi Don,

Contacted sales and could download the 9.0.695.0 from the download center.

We have put the new DLL’s to test and seems like there is no change. It still rendering very slow and the output window still shows the same message.

When run 4326 cache works and CPU % stays below 20%. But when other projections are used 900913, 3857, output window shows “WMS SERVER: Not Aligned with TileMatrix” and the CPU% goes to 60-70%.

Please do suggest us.

Thank you,
Uday

We test your code, it didn’t show any warning message.

Please confirm the items:

  1. In our code the default value of MapSuiteDebugger.Level is MapSuiteLogLevel.None, please check if you modify the value of MapSuiteDebugger.Level in you code. if you set MapSuiteDebugger.Level to Debug or All, it will still show the debug message, please change that back to MapSuiteLogLevel.None.

  2. After you updated the dlls, please clean the bin folder then rebuild your service and try again.

If you still met the same issue, could you please send your sample project with full dlls, so we can do the further testing.

About performance, we hadn’t found the CPU increase when the test project run.

And we suggest you don’t use reprojection in your plugin code, you can convert the data projection in the utility like our GisEditor, which should be help on performance.

Regards,

Don

Hi Don,

We have downloaded v695 and it seems like the changes for WMS v1.3.0 parameters “Time”, “Elevation” etc. which were there in v685 where not present in v695.

Contacted sales and they have asked to post in forums, Can you please check whether this is a different build?

Thanks

Hi Udaya,

We double check the build 9.0.695.0 assembly. it contains the Time and Elevation properties.This change only is applied on Development branch. Please confirm you are using 9.0.695.0.

If you still cannot find those parameters, please let us know that.

Thanks
Mark

Hi Mark,

Yes, we are using v695. Please find attached DLL’s.

Thanks,
UdayWMSServerEdition_v695.zip (2.3 MB)

Hi Udaya,

I checked your attached dlls, they are product version(the version number is 9.0.0.696). the Time and Elevation properties change only applied on development version (9.0.695.0). Please get the latest development version with Product Center.

If there is any question, please feel free to contact us.