GeoPositioning in raster file .sid with .sdw file

Topics: General Topics, SharpMap v0.9 / v1.x, WinForms Controls
May 30, 2012 at 3:08 PM

Hi, my name is Diego.
I have a raster file in .sid file with your .sdw. I load the file in my sharpmap application.
The problem is i need position points in this map with format Degree, decimals, but the reference of this map is different. When i get a point with worldpos in a map, i get this values (-6507027.81837363, -4066349.48306881) and i need some like this (58.382,34.604) lon\lat.


Which can i do for set the coordinate system of the map or the coordinate transform?
I did try this:


ProjNet.CoordinateSystems.Transformations.CoordinateTransformationFactory ctFact = new ProjNet.CoordinateSystems.Transformations.CoordinateTransformationFactory();               ProjNet.CoordinateSystems.ICoordinateSystem wgs84 = ProjNet.CoordinateSystems.GeographicCoordinateSystem.WGS84;            CoordinateSystemFactory csf = new CoordinateSystemFactory();               ProjNet.CoordinateSystems.ICoordinateSystem utm33 = ((GdalRasterLayer)mapBox1.Map.BackgroundLayer[0]).GetProjection();                 ProjNet.CoordinateSystems.Transformations.ICoordinateTransformation transformation = ctFact.CreateFromCoordinateSystems(utm33,wgs84); 
double[] coords = transformation.MathTransform.Transform(new double[] { WorldPos.X, WorldPos.Y });


But the result is wrong and in some files i get the error ("Missing projection parameter'latitude_of_origin'").
Also i did try apply the transform to the layer but nothing show in the control.


Any help is appreciated.

Sorry for my english.


Best regards.Diego.

Coordinator
Jun 5, 2012 at 12:27 PM

Maybe this thread can help you

http://projnet.codeplex.com/discussions/352813

Hth FObermaier