Latitude wrong - mercator to WGS84, longitude fine

Jun 2, 2010 at 1:54 PM

Hello - anyone run into this?

Trying to transform from a Mercator to WGS84.  After using the following the Latitude is wrong.  I'm looking for latitude values like 43.xxxx, 44.xxxx but I get values like 6.xxxxx.  The longitude value appears fine. ANY IDEAS?

 

ICoordinateSystem latlon = ProjNet.CorodinateSystems.GeographicCoordinateSystem.WGS84;

ICoordinateSystem mercator = GetMercatorProjection();

CoordinateTransformationFactory ctfac = new CoordinateTransformationFactory();

ICoordinateTransformation transformation = ctfac.CreateFromCoordinateSystems(mercator, latlon);

ICoordinateTransformation transform = transformation;

double[] converted = transform.MathTransform.Transform(values);

 

private ICoordinateSystem GetMercatorProjection() {

CoordinateSystemFactory factory = new CoordinateSystemFactory():

IGeographicCoordinateSystem wgs84 = (IGeographicCoordinateSystem) GeographicCoordinateSystem.WGS84;

List<ProjectionParameter> parameters = new List<ProjectionParameter>{

new ProjectionParameter("semi_major", 6378137.0),

new ProjectionParameter("semi_minor", 6356752.31414035610),

new ProjectionParameter("latitude_of_origin", 41.6666667),

new ProjectionParameter("central_meridian", -115.750000),

new ProjectionParameter("scale_factor", 1.000113),

new ProjectionParameter("false_easting", 2625138.996431),

new ProjectionParameter("false_northing", 0.0)

}

IProjection projection = factory.CreateProjection("Mercator", "mercator_1sp", parameters);

IProjectedCoordinateSystem mercator = factory.CreateProjectedCoordinateSystem("Mercator", wgs84, projection, LinearUnit.Metre, new AxisInfo("East", AxisOrientationEnum.East), new AxisInfo("North", AxisOrientationEnum.North));

return mercator;

}

Jun 2, 2010 at 2:05 PM

RESOLVED:

after doing a little more research I changed the mercator_1sp to transverse_mercator.  Everything ok now.