ThinkGeo.com    |     Documentation    |     Premium Support

WMTS Hard Crash

Hi,

We’re using public WMTS service for a background, but require user to input what the CRS is. The WMTS is in Spherical Mercator projection, but one user entered WGS84 lat/long projection. When the map tried to refresh, it caused a hard crash that killed the application with the following going to the output window.

ERROR 1: latitude or longitude exceeded limits
ERROR 1: Reprojection failed, err = -14, further errors will be supressed on the transform object.
ERROR 1: Too many points (440 out of 441) failed to transform,
unable to compute output bounds.

I have the DrawingException event on the layer, but this issue is not trapped by that. Not sure if the event is broken or the crash happens before drawing.

Also, what is best way to automatically determine CRS of WMTS layer? It seems the capabilities xml is not as standard as WMS layer making it problematic to parse.

Regards,
Damian

Thanks Damian,
Drop a Spherical Mercator point to the Meter unit map or try to convert Spherical Mercator to Spherical Mercator point will threw the error you mentioned. Because the Spherical Mercator is very large. Convert a very large value to larger one will get the value exceeded limits. We may need limit the user’s input. Warning the user the input can’t be … and let the user adjust the input.

Thanks

Frank

Hi Frank,

Since it’s completely feasible to have a layer in EPSG 4326, I can’t prevent the user from choosing this as an option. Best I have come up with is to parse GetCapabilities and test for the various possible variations of how WMTS is reporting CRS and ask the user to confirm. It’s ugly code really.

The fact that it results in a hard crash of the program also means user can lose data.

There really should be a way to trap the error and report it instead of crashing.

Regards,
Damian

Thanks Damian,
I still don’t full understand your scenario.
These two methods could get some server information.
wmtsLayer.GetServerCapabilitiesXml();
wmtsLayer.GetServerTileMatrixSetNames();

The exception is come from when we do the projection conversion. We may need limit the zoom level/extent for some scenario. If we swallow the exception the layer may mess up. User will also report the issue.

Thanks

Frank