SharpMap.CoordinateSystems.CoordinateSystemFactory.CreateHorizontalDatum C# (CSharp) 메소드

CreateHorizontalDatum() 공개 메소드

Creates HorizontalDatum from ellipsoid and Bursa-World parameters.
Since this method contains a set of Bursa-Wolf parameters, the created datum will always have a relationship to WGS84. If you wish to create a horizontal datum that has no relationship with WGS84, then you can either specify a DatumType">horizontalDatumType of
public CreateHorizontalDatum ( string name, DatumType datumType, IEllipsoid ellipsoid, Wgs84ConversionInfo toWgs84 ) : IHorizontalDatum
name string Name of ellipsoid
datumType DatumType Type of datum
ellipsoid IEllipsoid Ellipsoid
toWgs84 Wgs84ConversionInfo Wgs84 conversion parameters
리턴 IHorizontalDatum
        public IHorizontalDatum CreateHorizontalDatum(string name, DatumType datumType, IEllipsoid ellipsoid, Wgs84ConversionInfo toWgs84)
        {
            if (string.IsNullOrEmpty(name))
                throw new ArgumentException("Invalid name");
            if (ellipsoid == null)
                throw new ArgumentException("Ellipsoid was null");

            return new HorizontalDatum(ellipsoid, toWgs84, datumType, name, String.Empty, -1, String.Empty, String.Empty, String.Empty);
        }

Usage Example

예제 #1
0
	private void TestMercator_2SP()
	{
		CoordinateSystemFactory cFac = new SharpMap.CoordinateSystems.CoordinateSystemFactory();

		IEllipsoid ellipsoid = cFac.CreateFlattenedSphere("Krassowski 1940", 6378245.0, 298.3, LinearUnit.Metre);

		IHorizontalDatum datum = cFac.CreateHorizontalDatum("Krassowski 1940", DatumType.HD_Geocentric, ellipsoid, null);
		IGeographicCoordinateSystem gcs = cFac.CreateGeographicCoordinateSystem("Krassowski 1940", AngularUnit.Degrees, datum, 
			PrimeMeridian.Greenwich, new AxisInfo("Lon", AxisOrientationEnum.East),
			new AxisInfo("Lat", AxisOrientationEnum.North));
        List<ProjectionParameter> parameters = new List<ProjectionParameter>();
		parameters.Add(new ProjectionParameter("latitude_of_origin", 42));
		parameters.Add(new ProjectionParameter("central_meridian", 51));
		parameters.Add(new ProjectionParameter("false_easting", 0));
		parameters.Add(new ProjectionParameter("false_northing", 0));
		IProjection projection = cFac.CreateProjection("Mercator_2SP", "Mercator_2SP", parameters);

		IProjectedCoordinateSystem coordsys = cFac.CreateProjectedCoordinateSystem("Pulkovo 1942 / Mercator Caspian Sea", gcs, projection, LinearUnit.Metre, new AxisInfo("East", AxisOrientationEnum.East), new AxisInfo("North", AxisOrientationEnum.North));

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

		SharpMap.Geometries.Point pGeo = new SharpMap.Geometries.Point(53,53);
		SharpMap.Geometries.Point pUtm = new Point(trans.MathTransform.Transform(pGeo.ToDoubleArray()));
        SharpMap.Geometries.Point pGeo2 = new Point(trans.MathTransform.Inverse().Transform(pUtm.ToDoubleArray()));

		result.Text += PrintResultTable(gcs, coordsys, pGeo, pUtm, new Point(165704.29, 5171848.07), pGeo2, "Mercator_2SP test");
	}
All Usage Examples Of SharpMap.CoordinateSystems.CoordinateSystemFactory::CreateHorizontalDatum