URGENT: Projection problem

Jan 14, 2007 at 1:19 PM
SharpMap api is not displaying layers on virtual earth. There are two types of projection files

1) PROJCS"Irish_National_Grid",GEOGCS["GCS_TM65",DATUM["D_TM65",SPHEROID["Airy_Modified",6377340.189,299.3249646]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",200000.0],PARAMETER["False_Northing",250000.0],PARAMETER["Central_Meridian",-8.0],PARAMETER["Scale_Factor",1.000035],PARAMETER["Latitude_Of_Origin",53.5],UNIT["Meter",1.0]

2) GEOGCS"GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.0174532925199433]


Virtual Earth Tile server code is working with SharpMap when i use (2) projection file. but it is not working with (1) projection file.


I am using below code to run with (1) projection file.
int utmZone = 32;
IEllipsoid ellipsoid = cFac.CreateFlattenedSphere("WGS 84", 6378137, 298.257223563, LinearUnit.Metre);
IHorizontalDatum datum = cFac.CreateHorizontalDatum("WGS1984", DatumType.HDGeocentric, ellipsoid, null);
IGeographicCoordinateSystem gcs = cFac.CreateGeographicCoordinateSystem("WGS 84", AngularUnit.Degrees, datum, PrimeMeridian.Greenwich, new AxisInfo("Lon", AxisOrientationEnum.East),
new AxisInfo("Lat", AxisOrientationEnum.North));

//Create UTM projection
System.Collections.Generic.List<ProjectionParameter> parameters = new System.Collections.Generic.List<ProjectionParameter>(5);
parameters.Add(new ProjectionParameter("latitudeoforigin", 0));
parameters.Add(new ProjectionParameter("central_meridian", -183 + 6 * utmZone));
parameters.Add(new ProjectionParameter("scale_factor", 0.9996));
parameters.Add(new ProjectionParameter("false_easting", 500000));
parameters.Add(new ProjectionParameter("false_northing", 0.0));
IProjection projection = cFac.CreateProjection("Transverse Mercator", "Transverse_Mercator", parameters);

IProjectedCoordinateSystem coordsys = cFac.CreateProjectedCoordinateSystem("WGS 84 / UTM zone " + utmZone.ToString() + "N", gcs, projection, LinearUnit.Metre, new AxisInfo("East", AxisOrientationEnum.East), new AxisInfo("North", AxisOrientationEnum.North));

return new CoordinateTransformationFactory().CreateFromCoordinateSystems(source, coordsys);


But this code is not displaying any layer on virtual earth. Can you pls suggest me what code i should use.
Coordinator
Jan 16, 2007 at 6:05 PM
Hi

Have you tested this already?
http://www.sharpgis.net/2006/09/16/OverlayingLocalLiveMapsWithYourOwnMapdata.aspx

BR
/Christian
Jan 17, 2007 at 6:53 AM
Yes. I have read that but it works only with normal projection files. It does not work with all type of projection files.