[mapguide-internals] PATCH: Ticket 600- coordinate system overriding fails

Troy Louden troy.louden at autodesk.com
Fri Sep 25 13:58:07 EDT 2009


Hey all,

This patch addresses the problems WMS has when specifying a spatial context in a configuration xml. The core of the issue lies in:
TransformCache* TransformCache::GetLayerToMapTransform()
In TransformCache.cpp.

This function is supposed to get the coordinate system of the layer and set up a transform. The spatial context is always set to the first in the list of supported spatial contexts unless a geometry property is found (in which case it defaults to the spatial context associated with that geometry). This means that the spatial context of WMS layers will always default to the first in the list regardless of what was set in the configuration document.

The fix is to first update the MgRasterPropertyDefinition class to support storing and retrieving a spatial context association and then modifying GetLayerToMapTransform()to use that spatial context to set up the transform.

The update to MgRasterPropertyDefinition is pretty simple. I added a string to store the spatial context and two methods to get and set it (modeled on MgGeometricPropertyDefinition). There are 4 places that manually copy the data members of property definitions that had to be updated to also copy the spatial context.

In GetLayerToMapTransform()I check for an additional property type (raster) and use that spatial context by default.

-Troy Louden




More information about the mapguide-internals mailing list