This project has moved. For the latest updates, please go here.

Coordinate Transformation on Label Layer

Topics: SharpMap Project, SharpMap v0.9 / v1.x
Mar 7, 2012 at 10:35 AM

Hi all, I have this problem:

when I do a CoordinateTransformation on a VectorLayer, I have to transformate his LabelLayer too. That's my code

CoordinateTransformationFactory ctf = new CoordinateTransformationFactory();
CoordinateSystemFactory csf = new CoordinateSystemFactory();
ICoordinateSystem OldCoords = csf.CreateFromWkt(oldwkt);
ICoordinateSystem NewCoords = csf.CreateFromWkt(newwkt);

ICoordinateTransformation ct1 = ctf.CreateFromCoordinateSystems(OldCoords, NewCoords);
ICoordinateTransformation ct2 = ctf.CreateFromCoordinateSystems(NewCoords, OldCoords);
VectorLayer.CoordinateTransformation = ct1;
VectorLayer.ReverseCoordinateTransformation = ct2;
LabelLayer.CoordinateTransformation = ct1;
LabelLayer.ReverseCoordinateTransformation = ct2;

When the code reaches the line "CoordinateTransformation.MathTransform.Invert();" I get a "NotImplementedException":
in LabelLayer.cs -> public override void Render(Graphics g, Map map): 

#if !DotSpatialProjections
envelope = GeometryTransform.TransformBox(envelope, CoordinateTransformation.MathTransform);

Maybe I did something wrong?

Mar 7, 2012 at 12:40 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.