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

CoordinateTransformation and ExecuteIntersectionQuery don't work together

Topics: Algorithms, SharpMap v0.9 / v1.x, WinForms Controls
Dec 18, 2011 at 10:10 AM


After loading the TileAsyncLayer with Google Map and Label layers, map queries are not working!

I set the CoordinateTransformation property of each layer to Wgs84toGoogleMercator as shown in the sample winforms app. The ICoordinateTransformation instance is created as below:

new CoordinateTransformation()
                                            Source = KnownCoordinateSystems.Geographic.World.WGS1984,
                                            Target = KnownCoordinateSystems.Projected.World.WebMercator

But the call to ExecuteIntersectionQuery on the VectorLayer always returns zero rows, in the OnMouseUp method of MapBox. Do I need to transform the mouse coordinates myself?


Dec 18, 2011 at 10:25 AM

Sorry! My mistake. I was performing true intersection testing using NTS in my own derived class. All I needed to do was apply the CoordinateTransform there also!