Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MathTransform.Transform modifies the original ICoordinateSequence #26

Closed
kshahar opened this issue Feb 21, 2018 · 1 comment
Closed

Comments

@kshahar
Copy link

kshahar commented Feb 21, 2018

This issue affects NetTopologySuite GeometryTransform. To reproduce:

var geometryServices = new NtsGeometryServices();
var geometryFactory = geometryServices.CreateGeometryFactory();

var coordinateTransformationFactory = new CoordinateTransformationFactory();
var transform = coordinateTransformationFactory.CreateFromCoordinateSystems(
    GeographicCoordinateSystem.WGS84,
    GeocentricCoordinateSystem.WGS84
);

var sequence = geometryFactory.CoordinateSequenceFactory.Create(
    new[] { new Coordinate(-75.212144, 39.952874, 1000) });
var convertedSequence = transform.MathTransform.Transform(sequence);
Console.WriteLine("Original : {0}\nConverted: {1}", sequence, convertedSequence);

Output:

Original : ((1249872.4843066079, -4734640.5686484585, 4074617.9450782747))
Converted: ((1249872.4843066079, -4734640.5686484585, 4074617.9450782747))
@terribletim
Copy link

Method summaries on the various transform methods in GeoAPI.CoordinateSystems.Transformations.IMathTransform say words to the effect of The input remains unchanged.

The implementation in ProjNet4GeoApi does not adhere to this.

Please are the project owners able to decide how to resolve this?

Current implementation does not lend itself to any easy choice! Would it be better to add new methods to clearly support preserving or modifying input coordinates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants