ProjNet4GeoAPI icon indicating copy to clipboard operation
ProjNet4GeoAPI copied to clipboard

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

Open mario-mu opened this issue 6 months ago • 4 comments

The change supports the UNIT Parameter between the Projection Parameter

mario-mu avatar May 06 '25 15:05 mario-mu

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar May 06 '25 15:05 CLAassistant

@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 avatar May 07 '25 15:05 FObermaier

The change supports the UNIT Parameter between the Projection Parameter

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

FObermaier avatar May 13 '25 08:05 FObermaier

@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.

mario-mu avatar May 14 '25 08:05 mario-mu