Latitude and Longitude not showing correctly

Apr 25, 2011 at 3:16 PM

Hello,  this should be an easy one for somebody out there.

I must be missing something.  I downloaded and ran the sample project with the "World Countries" shape files and the lat/long appear correct.
Then I changed the code to load my shape file instead of the "World Countries" and the lat/long appear out of wack.

I looked at the samples for transformations and that doesn't seem to apply because the shape files I am using should already have the correct projection that I want.

Can someone give me a nudge in the right direction.  I didn't include code because I believe that I'm missing something with how SharpMap works.

Coordinator
Apr 26, 2011 at 1:12 PM

Hello neutroz,

out of whack is probably what it looks like to you, but to give an answer, you need to describe more precisly what is going on or -even better- show us some images (along with code) or the shapefile in question.

cheers FObermaier

Apr 26, 2011 at 3:21 PM

Sorry - I'm new at this and figured out that that the "World Coordinates" (.ImageToWorld) in SharpMap are UTM.  I need to convert to Lat/Long.

I'll will have to find the necessary math to do the conversion.

Apr 26, 2011 at 6:01 PM

I was able to make the conversion.  Thanks for the help!?

Nov 8, 2012 at 11:36 AM
Edited Nov 9, 2012 at 12:10 PM

Hello,

I have the same question.

I would like to convert a ImageToWorld point to a WSG84 point or vice versa.

is there a converter available?

EDIT :

I found this page : http://sharpmap.codeplex.com/wikipage?title=Apply%20on%20the%20fly%20transformation%20to%20a%20layer

 

I think I need only 

//Create transformation
CoordinateTransformationFactory ctFac = new CoordinateTransformationFactory();
ICoordinateTransformation transform = ctFac.CreateFromCoordinateSystems(source, target);

//Apply transformation to a vectorlayer
(myMap.Layers[0] as VectorLayer).CoordinateTransformation = transform;

 

but how to create an UTM and WGS84 coordinate system whithout specific (spheric) projection ?

 

Thanks

Nov 11, 2012 at 1:19 PM

it's ok.

Map coordinates are not in UTM but in Epsg3785

 

new CoordinateSystemFactory().CreateFromWkt(                                                                        "PROJCS[\"Popular Visualisation CRS / Mercator\", " +                                                                        "GEOGCS[\"Popular Visualisation CRS\", " +                                                                        "DATUM[\"Popular Visualisation Datum\", " +                                                                        "SPHEROID[\"Popular Visualisation Sphere\", 6378137, 0, AUTHORITY[\"EPSG\",\"7059\"]], " +                                                                        "TOWGS84[0, 0, 0, 0, 0, 0, 0], " +                                                                        "AUTHORITY[\"EPSG\",\"6055\"]], " +                                                                        "PRIMEM[\"Greenwich\", 0, AUTHORITY[\"EPSG\", \"8901\"]], " +                                                                        "UNIT[\"degree\", 0.0174532925199433, AUTHORITY[\"EPSG\", \"9102\"]], " +                                                                        "AXIS[\"E\", EAST], AXIS[\"N\", NORTH], " +                                                                        "AUTHORITY[\"EPSG\",\"4055\"]], " +                                                                        "PROJECTION[\"Mercator\"], " +                                                                        "PARAMETER[\"False_Easting\", 0], " +                                                                        "PARAMETER[\"False_Northing\", 0], " +                                                                        "PARAMETER[\"Central_Meridian\", 0], " +                                                                        "PARAMETER[\"Latitude_of_origin\", 0], " +                                                                        "UNIT[\"metre\", 1, AUTHORITY[\"EPSG\", \"9001\"]], " +                                                                        "AXIS[\"East\", EAST], AXIS[\"North\", NORTH], " +                                                                        "AUTHORITY[\"EPSG\",\"3785\"]]");