|
|
Can anyone confrim that, the map on this project's home, is it the conversion from OSGB36 to WGS84?
Can anyone provide a code sample for this?
|
|
|
|
This does it the other way round... simply change the source and target variable names and it should work.
CoordinateSystemFactory c = new CoordinateSystemFactory();
ICoordinateSystem target = c.CreateFromWkt("PROJCS[\"OSGB 1936 / British National Grid\",GEOGCS[\"OSGB 1936\",DATUM[\"OSGB_1936\",SPHEROID[\"Airy 1830\",6377563.396,299.3249646,AUTHORITY[\"EPSG\",\"7001\"]],AUTHORITY[\"EPSG\",\"6277\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4277\"]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"latitude_of_origin\",49],PARAMETER[\"central_meridian\",-2],PARAMETER[\"scale_factor\",0.9996012717],PARAMETER[\"false_easting\",400000],PARAMETER[\"false_northing\",-100000],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],AUTHORITY[\"EPSG\",\"27700\"]]");
ICoordinateSystem source = c.CreateFromWkt("GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.0174532925199433]]");
CoordinateTransformationFactory trf = new CoordinateTransformationFactory();
ICoordinateTransformation tr = trf.CreateFromCoordinateSystems(source, target);
double[] point = new double[] {-4.0, 55.6};
double[] result = tr.MathTransform.Transform(point);
Console.WriteLine(result);
|
|