[Solved] Converting to a CRS and the back to the original CRS, not the same original coordinates

scott_f Asks: Converting to a CRS and the back to the original CRS, not the same original coordinates
I am using Proj4Net to convert between coordinate systems. I’ve noticed that when I convert from one coordinate systems (CRS) and them back to the original CRS, the coordinate Y values have changed when I convert back to the original CRS.

E.g. Original EPSG 2105 X: 372893.221 Y: 809590.1314

Convert to EPSG 3857: X: 19420845.9813353 Y: -4410280.07002807

Convert back to EPSG 2105 X: 372893.221025973 Y: 809590.123207413

I have since used several different EPSG values with the same sort of results.

Its always the coordinate Y values that are distored from the original.

The coordinate X values seem to convert relatively correctly.

Here is the code from my method that converts between CRS:

            var cs_from = SridReader.GetCSbyID(from_epsg);
            var cs_to = SridReader.GetCSbyID(to_epsg);

            var ctfac = new CoordinateTransformationFactory();
            var trans = ctfac.CreateFromCoordinateSystems(cs_from, cs_to);

            var from_TopLeftCorner = new double[] { bbox_from.Min_X, bbox_from.Max_Y };
            double[] toTopLeftCorner = trans.MathTransform.Transform(from_TopLeftCorner);

            var from_BottomRightCorner = new double[] { bbox_from.Max_X, bbox_from.Min_Y };
            double[] toBottomRightCorner = trans.MathTransform.Transform(from_BottomRightCorner);

            var converted_bbox = new BoundingBox_Model
                Min_X = toTopLeftCorner[0],
                Max_Y = toTopLeftCorner[1],
                Max_X = toBottomRightCorner[0],
                Min_Y = toBottomRightCorner[1]

Is this behaviour expected or am I doing something wrong?

As I am inserting the image to use for GIS the image’s location needs to be extremely accurate.

Is this possible when converting between CRS?

Ten-tools.com may not be responsible for the answers or solutions given to any question asked by the users. All Answers or responses are user generated answers and we do not have proof of its validity or correctness. Please vote for the answer that helped you in order to help others find out which is the most helpful answer. Questions labeled as solved may be solved or may not be solved depending on the type of question and the date posted for some posts may be scheduled to be deleted periodically. Do not hesitate to share your response here to help other visitors like you. Thank you, Ten-tools.