Skip to content

Fixed an error when importing projected coordinate systems. Support o…#128

Merged
FObermaier merged 2 commits into
NetTopologySuite:developfrom
TKI-Chemnitz:bugfix/ReadingUnit
Aug 15, 2025
Merged

Fixed an error when importing projected coordinate systems. Support o…#128
FObermaier merged 2 commits into
NetTopologySuite:developfrom
TKI-Chemnitz:bugfix/ReadingUnit

Conversation

@mario-mu

@mario-mu mario-mu commented May 6, 2025

Copy link
Copy Markdown
Contributor

The change supports the UNIT Parameter between the Projection Parameter

@CLAassistant

CLAassistant commented May 6, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@FObermaier

Copy link
Copy Markdown
Member

@Maddogtet , thank you for this contribution and signing the CLA.
Do you mind rebasing you PR on current development branch so we can see the CI working? That would be great.

@FObermaier

Copy link
Copy Markdown
Member

The change supports the UNIT Parameter between the Projection Parameter

Is this common? Where do you get the WKT from?

@mario-mu

mario-mu commented May 14, 2025

Copy link
Copy Markdown
Contributor Author

@FObermaier looks like this is a problem with the current release from the master branch
Creating a coordinate system from correct wkt with the current release, leads to this broken wkt if you read it again from the coordinate system.

            string wkt = "PROJCS[\"DHDN_3_Degree_Gauss_Zone_4\",GEOGCS[\"GCS_Deutsches_Hauptdreiecksnetz\",DATUM[\"D_Deutsches_Hauptdreiecksnetz\",SPHEROID[\"Bessel_1841\",6377397.155,299.15281280],TOWGS84[598.1000,73.7000,418.2000,-0.202000,-0.045000,2.455000,6.70000000]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]],PROJECTION[\"Transverse_Mercator\"],PARAMETER[\"False_Easting\",4500000.000],PARAMETER[\"False_Northing\",0.000],PARAMETER[\"Scale_Factor\",1.000000000000],PARAMETER[\"Central_Meridian\",12.00000000000000],PARAMETER[\"Latitude_Of_Origin\",0.00000000000000],UNIT[\"Meter\",1.00000000000000]]";
            var coordinateSystemFactory = new CoordinateSystemFactory();
            var coord = coordinateSystemFactory.CreateFromWkt(wkt);
            Assert.NotNull(coord);
            Assert.AreEqual(wkt, coord.WKT);

I was not able the reproduce the creation of that broken wkt with any of our used applications (QGIS, Map3d) but anyone using current ProjNET relase can create the corrupted wkt.

I do not see any problems with the changes, due to its just additionaly to the current working solution.

@FObermaier FObermaier merged commit b0ad08c into NetTopologySuite:develop Aug 15, 2025
6 checks passed
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

Successfully merging this pull request may close these issues.

3 participants