1

I'm not experienced with GIS. I received long/lat data and need to convert them to GIS.

Here are code examples from the library ProjNet4GeoAPI : https://github.com/NetTopologySuite/ProjNet4GeoAPI/blob/master/ProjNet.Tests/CoordinateTransformTests.cs

Here is the code I have after I started transforming the first example:

        public static void ToEpsg2154()
    {
        ICoordinateSystem epsg2154CoordinateSystem = (new CoordinateSystemFactory()).CreateFromWkt("PROJCS[\"RGF93 / Lambert-93\",GEOGCS[\"RGF93\",DATUM[\"Reseau_Geodesique_Francais_1993\",SPHEROID[\"GRS 1980\",6378137,298.257222101,AUTHORITY[\"EPSG\",\"7019\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6171\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.01745329251994328,AUTHORITY[\"EPSG\",\"9122\"]],AUTHORITY[\"EPSG\",\"4171\"]],UNIT[\"metre\",1,AUTHORITY[\"EPSG\",\"9001\"]],PROJECTION[\"Lambert_Conformal_Conic_2SP\"],PARAMETER[\"standard_parallel_1\",49],PARAMETER[\"standard_parallel_2\",44],PARAMETER[\"latitude_of_origin\",46.5],PARAMETER[\"central_meridian\",3],PARAMETER[\"false_easting\",700000],PARAMETER[\"false_northing\",6600000],AUTHORITY[\"EPSG\",\"2154\"],AXIS[\"X\",EAST],AXIS[\"Y\",NORTH]]");
        IProjectedCoordinateSystem utm33 = ProjectedCoordinateSystem.WGS84_UTM(33, true);
        ICoordinateTransformation trans = (new CoordinateTransformationFactory()).CreateFromCoordinateSystems(epsg2154CoordinateSystem, utm33);

        Coordinate[] points = new Coordinate[]
        {
            new Coordinate(290586.087, 6714000), new Coordinate(290586.392, 6713996.224),
            new Coordinate(290590.133, 6713973.772), new Coordinate(290594.111, 6713957.416),
            new Coordinate(290596.615, 6713943.567), new Coordinate(290596.701, 6713939.485)
        };

        Coordinate[] tpoints = trans.MathTransform.TransformList(points).ToArray();
    }

I'm pretty sure that I am missing something as the example inputs don't seem to be lat/long to me.

I am not sure what I should change or which other example I should start with.

0

I had missed that point but I just realised that ProjNet4GeoAPI is based on Proj.NET, which helped me find more example.

The following one seems to have solved my problem: Code to convert WGS84 coordinates to British National Grid Easting/Northings

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.