MapPoint.Project(...) to other spatial has insufficient accuracy (with 31256)

361
2
Jump to solution
02-13-2023 11:55 PM
SokoFromNZ
Occasional Contributor

I have found a bug (?) in your projecting algorithmn which leads to a 200 meter error.

This line:

var wgs84 = (MapPoint) new MapPoint(-76819.429, 187725.102, SpatialReference.Create(31256) ).Project(SpatialReferences.Wgs84); 

Calculates to:

{MapPoint[X=15.321529847554814, Y=46.82430179466435, Wkid=4326]}

 As I know what feature on the satellite map should be there I see this is off.

In addition using https://products.aspose.app/gis/en/transformation for the projection leads to the correct 4326 values of

15.32549716745482 46.82433872507569

 

As I'm a novice in all this geo spatial stuff I may be using it wrong. But I can't see where...

Thanks for your help in advance

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
dotMorten_esri
Esri Notable Contributor

Does this projection require datum grid transformation? If so, did you supply the projection engine with the data necessary? See https://developers.arcgis.com/net/spatial-and-data-analysis/spatial-references/#grid-based-transform...

View solution in original post

0 Kudos
2 Replies
dotMorten_esri
Esri Notable Contributor

Does this projection require datum grid transformation? If so, did you supply the projection engine with the data necessary? See https://developers.arcgis.com/net/spatial-and-data-analysis/spatial-references/#grid-based-transform...

0 Kudos
SokoFromNZ
Occasional Contributor

Hi,

Yeah... it seems I am missing the transformation for this projection. 

Now with

var target = SpatialReference.Create(31256);
var transformation = TransformationCatalog.GetTransformation(target, SpatialReferences.Wgs84,
            new Envelope(data.Min(a => a.X), data.Min(a => a.Y), data.Max(a => a.X), data.Max(a => a.Y), target));
...
var wgs84 = (MapPoint) new MapPoint(x, y, target).Project(SpatialReferences.Wgs84, transformation);
...

it delivers the correct values.

Thanks

0 Kudos