Quantcast
Channel: DotSpatial Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 1128

Commented Unassigned: Incorrect toWgs84 initialisation in Proj4DatumName set accesor [63501]

$
0
0
There is an issue with Datum.Proj4DatumName set acessor that causes incorrect projections for British National Grid (OSGB36) when ProjectionInfo.FromAuthorityCode("EPSG", 27700) is used.

Suggested workaround seemed to be use of proj4string, see https://dotspatial.codeplex.com/workitem/24909

This issue will affect all DatumType.Param7 - "ire65", "nzgd49", "osgb36"

At the moment code is
```
case "osgb36":
_toWgs84 = new[] { 446.448, -125.157, 542.060, 0.1502, 0.2470, 0.8421, -20.4894 };
```

and should be
```
case "osgb36":
InitializeToWgs84(new[] { "446.448", "-125.157", "542.060", "0.1502", "0.2470", "0.8421", "-20.4894" });
```

Current initialisation does not apply required transformations to _toWgs84[3] - _toWgs84[6], so when ToProj4String() is called incorrect projection string is returned.

Test case:
```
ProjectionInfo sourceProjection = ProjectionInfo.FromAuthorityCode("EPSG", 27700);
ProjectionInfo targetProjection = ProjectionInfo.FromAuthorityCode("EPSG", 4326);
double[] xy = new double[2] { 465000, 170000 };
Reproject.ReprojectPoints(xy, null, sourceProjection, targetProjection, 0, 1);

// see http://www.ordnancesurvey.co.uk/gps/transformation
double expectedX = -1.066488;
double expectedY = 51.425291;
double eps = 0.0001;
Debug.Assert(Math.Abs(xy[0] - expectedX) <= eps);
Debug.Assert(Math.Abs(xy[1] - expectedY) <= eps);
```
Comments: ** Comment from web user: HUrmenyi **

See also issue 24909


Viewing all articles
Browse latest Browse all 1128

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>