This project has moved and is read-only. For the latest updates, please go here.

GdalRasterLayer's bug !

Topics: Algorithms, CompactFramework, Data Access, Español, General Topics, Italiano, SharpMap Project, SharpMap v0.9 / v1.x, SharpMap v2.0, WinForms Controls
Feb 28, 2011 at 5:22 PM
Edited Feb 28, 2011 at 5:22 PM

    When I use GdalRasterLayer to display my Image, I found that the GdalRasterLayer that can't display the first line and the first colume. I don't know why? Does somebody encounter the same question?

    The code that may have errors is in the following code:

                                GndX = dblMapMinX + (PixX + bitmapTLX) * dblMapPixelWidth;
                                GndY = dblMapMaxY - (PixY + bitmapTLY) * dblMapPixelHeight;

                                // transform ground point if needed
                                if (_transform != null)

                                    dblPoint = inverseTransform.Transform(new[] { GndX, GndY });
                                    GndX = dblPoint[0];
                                    GndY = dblPoint[1];

                                // PS: most of time that the first line and colume's ImgX or ImgY are out of the range between imageTL and imageBR.The it will continue!

                                ImgX = (geoLeft + geoHorzPixRes * GndX + geoXRot * GndY);
                                ImgY = (geoTop + geoYRot * GndX + geoVertPixRes * GndY);

                                if (ImgX < imageTL.X || ImgX > imageBR.X || ImgY < imageTL.Y || ImgY > imageBR.Y)


Any clue will be appriciated! Thanks again!

Mar 1, 2011 at 9:46 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.