SharpMap.CoordinateSystems.CoordinateSystemFactory.CreateGeocentricCoordinateSystem C# (CSharp) Method

CreateGeocentricCoordinateSystem() public method

Creates a CreateGeocentricCoordinateSystem from a datum, ILinearUnit">linear unit and
public CreateGeocentricCoordinateSystem ( string name, IHorizontalDatum datum, ILinearUnit linearUnit, IPrimeMeridian primeMeridian ) : IGeocentricCoordinateSystem
name string Name of geocentric coordinate system
datum IHorizontalDatum Horizontal datum
linearUnit ILinearUnit Linear unit
primeMeridian IPrimeMeridian Prime meridian
return IGeocentricCoordinateSystem
        public IGeocentricCoordinateSystem CreateGeocentricCoordinateSystem(string name, IHorizontalDatum datum, ILinearUnit linearUnit, IPrimeMeridian primeMeridian)
        {
            if (string.IsNullOrEmpty(name))
                throw new ArgumentException("Invalid name");
            List<AxisInfo> info = new List<AxisInfo>(3);

            info.Add(new AxisInfo("X", AxisOrientationEnum.Other));
            info.Add(new AxisInfo("Y", AxisOrientationEnum.Other));
            info.Add(new AxisInfo("Z", AxisOrientationEnum.Other));
            return new GeocentricCoordinateSystem(datum, linearUnit, primeMeridian, info, name,String.Empty,-1,String.Empty,String.Empty,String.Empty);
        }

Usage Example

Exemplo n.º 1
0
    private void TestGeocentric()
    {
        CoordinateSystemFactory cFac = new SharpMap.CoordinateSystems.CoordinateSystemFactory();

        IGeographicCoordinateSystem gcs = cFac.CreateGeographicCoordinateSystem("WGS84", AngularUnit.Degrees, HorizontalDatum.WGS84,
                                                                                PrimeMeridian.Greenwich, new AxisInfo("Lon", AxisOrientationEnum.East), new AxisInfo("Lat", AxisOrientationEnum.North));
        IGeocentricCoordinateSystem geoccs = cFac.CreateGeocentricCoordinateSystem("WGS84 geocentric", gcs.HorizontalDatum, LinearUnit.Metre, PrimeMeridian.Greenwich);

        ICoordinateTransformation trans = new CoordinateTransformationFactory().CreateFromCoordinateSystems(gcs, geoccs);

        SharpMap.Geometries.Point3D pGeo  = new SharpMap.Geometries.Point3D(2.12955, 53.80939444, 73);
        SharpMap.Geometries.Point3D pGc   = new Point3D(trans.MathTransform.Transform(pGeo.ToDoubleArray()));
        SharpMap.Geometries.Point3D pGeo2 = new Point3D(trans.MathTransform.Inverse().Transform(pGc.ToDoubleArray()));

        result.Text += PrintResultTable(gcs, geoccs, pGeo, pGc, new Point3D(3771793.97, 140253.34, 5124304.35), pGeo2, "Geocentric test");

        return;
    }
All Usage Examples Of SharpMap.CoordinateSystems.CoordinateSystemFactory::CreateGeocentricCoordinateSystem