ProjNet4GeoAPI icon indicating copy to clipboard operation
ProjNet4GeoAPI copied to clipboard

Transform between the same coordinate system

Open afroewis opened this issue 6 years ago • 0 comments

Hi,

This libary is great! Great job.

In my case I am dealing with this CRS: https://epsg.io/2056 - it uses Hotine Oblique Mercator Azimuth Center projection, which is not supported. This is how I transform between CRS:

var trans = (new CoordinateTransformationFactory()).CreateFromCoordinateSystems(sourcePoint.CoordinateSystem, targetCoordinateSystem);

var sourcePointTemp = new[]
{
    sourcePoint.LongitudeOrEasting,
    sourcePoint.LatitudeOrNorthing
};
    var targetPoint = trans.MathTransform.Transform(sourcePointTemp);

If both the source and the target CRS are the same, there is no transformation needed. I would expect that the transformation factory would just return the source point in this case. But instead, it throws an exception (because my CRS is not supported).

Would it make sense to change this behavior? i would be very happy to create a PR if you agree.

Thanks!

afroewis avatar Jun 21 '19 06:06 afroewis