コード例 #1
0
        /// <summary>
        /// Transforms the specified ellipsoid to be measured by the specified unit of measurement.
        /// </summary>
        /// <param name="ellipsoid">The ellipsoid.</param>
        /// <param name="unitOfMeasurement">The unit of measurement.</param>
        /// <returns>The ellipsoid measured by the specified unit of measurement.</returns>
        /// <exception cref="System.ArgumentNullException">The ellipsoid is null.</exception>
        /// <exception cref="System.ArgumentException">The unit of measurement must be a length quantity.</exception>
        public static Ellipsoid ReMeasure(this Ellipsoid ellipsoid, UnitOfMeasurement unitOfMeasurement)
        {
            if (ellipsoid == null)
            {
                throw new ArgumentNullException("ellipsoid", "The ellipsoid is null.");
            }
            if (unitOfMeasurement.Type != UnitQuantityType.Length)
            {
                throw new ArgumentException("The unit of measurement must be a length quantity.", "unitOfMeasurement");
            }

            if (ellipsoid.SemiMajorAxis.Unit.Equals(unitOfMeasurement))
            {
                return(ellipsoid);
            }

            if (ellipsoid.IsSphere)
            {
                return(Ellipsoid.FromSphere(ellipsoid.Identifier, ellipsoid.Name, new Length(ellipsoid.SemiMajorAxis.GetValue(unitOfMeasurement), unitOfMeasurement)));
            }
            else
            {
                return(Ellipsoid.FromInverseFlattening(ellipsoid.Identifier, ellipsoid.Name, new Length(ellipsoid.SemiMajorAxis.GetValue(unitOfMeasurement), unitOfMeasurement), ellipsoid.InverseFattening));
            }
        }
コード例 #2
0
        public void SetUp()
        {
            Dictionary <CoordinateOperationParameter, Object> parameters = new Dictionary <CoordinateOperationParameter, Object>();

            parameters = new Dictionary <CoordinateOperationParameter, Object>();
            parameters.Add(CoordinateOperationParameters.LatitudeOf1stStandardParallel, Angle.FromDegree(30));
            parameters.Add(CoordinateOperationParameters.LongitudeOfNaturalOrigin, Angle.FromDegree(-75));
            parameters.Add(CoordinateOperationParameters.FalseEasting, Length.FromMetre(0));
            parameters.Add(CoordinateOperationParameters.FalseNorthing, Length.FromMetre(0));

            Ellipsoid ellipsoid = Ellipsoid.FromSphere("EPSG::7052", "Clarke 1866 Authalic Sphere", 6370997);
            AreaOfUse areaOfUse = TestUtilities.ReferenceProvider.AreasOfUse["EPSG::1262"];

            this.projection = new LambertCylindricalEqualAreaSphericalProjection(IdentifiedObject.UserDefinedIdentifier, IdentifiedObject.UserDefinedName, parameters, ellipsoid, areaOfUse);
        }
コード例 #3
0
        public void SetUp()
        {
            Dictionary <CoordinateOperationParameter, Object> parameters = new Dictionary <CoordinateOperationParameter, Object>();

            parameters = new Dictionary <CoordinateOperationParameter, Object>();
            parameters.Add(CoordinateOperationParameters.LatitudeOfNaturalOrigin, Angle.FromDegree(0));
            parameters.Add(CoordinateOperationParameters.LongitudeOfNaturalOrigin, Angle.FromDegree(0));
            parameters.Add(CoordinateOperationParameters.FalseEasting, Length.FromMetre(0));
            parameters.Add(CoordinateOperationParameters.FalseNorthing, Length.FromMetre(0));

            Ellipsoid ellipsoid = Ellipsoid.FromSphere(IdentifiedObject.UserDefinedIdentifier, IdentifiedObject.UserDefinedName, 6378137);
            AreaOfUse areaOfUse = TestUtilities.ReferenceProvider.AreasOfUse["EPSG::1262"];

            this.projection = new PopularVisualisationPseudoMercatorProjection(IdentifiedObject.UserDefinedIdentifier, IdentifiedObject.UserDefinedName, parameters, ellipsoid, areaOfUse);
        }
コード例 #4
0
        public void SetUp()
        {
            Dictionary <CoordinateOperationParameter, Object> parameters = new Dictionary <CoordinateOperationParameter, Object>();

            parameters.Add(CoordinateOperationParameters.LatitudeOfNaturalOrigin, Angle.FromDegree(0));
            parameters.Add(CoordinateOperationParameters.LongitudeOfNaturalOrigin, Angle.FromDegree(110));
            parameters.Add(CoordinateOperationParameters.FalseEasting, Length.FromMetre(3900000));
            parameters.Add(CoordinateOperationParameters.FalseNorthing, Length.FromMetre(900000));
            parameters.Add(CoordinateOperationParameters.ScaleFactorAtNaturalOrigin, 0.997);

            _projectionA = new MercatorAProjection("EPSG::19905", "Netherlands East Indies Equatorial Zone", parameters, Ellipsoids.Bessel1841, AreasOfUse.World);

            parameters = new Dictionary <CoordinateOperationParameter, Object>();
            parameters.Add(CoordinateOperationParameters.LatitudeOf1stStandardParallel, Angle.FromDegree(42));
            parameters.Add(CoordinateOperationParameters.LongitudeOfNaturalOrigin, Angle.FromDegree(51));
            parameters.Add(CoordinateOperationParameters.FalseEasting, Length.FromMetre(0));
            parameters.Add(CoordinateOperationParameters.FalseNorthing, Length.FromMetre(0));

            _projectionB = new MercatorBProjection("EPSG::19884", "Caspian Sea Mercator", parameters, Ellipsoids.Krassowsky1940, AreasOfUse.World);

            parameters = new Dictionary <CoordinateOperationParameter, Object>();
            parameters.Add(CoordinateOperationParameters.LatitudeOfNaturalOrigin, Angle.FromDegree(0));
            parameters.Add(CoordinateOperationParameters.LongitudeOfNaturalOrigin, Angle.FromDegree(0));
            parameters.Add(CoordinateOperationParameters.FalseEasting, Length.FromMetre(0));
            parameters.Add(CoordinateOperationParameters.FalseNorthing, Length.FromMetre(0));

            _projectionSpherical = new MercatorSphericalProjection(IdentifiedObject.UserDefinedIdentifier, "World Spherical Mercator",
                                                                   Ellipsoid.FromSphere(IdentifiedObject.UserDefinedIdentifier, "Sphere", 6371007),
                                                                   parameters, AreasOfUse.World);

            parameters = new Dictionary <CoordinateOperationParameter, Object>();
            parameters.Add(CoordinateOperationParameters.LatitudeOfNaturalOrigin, Angle.FromDegree(0));
            parameters.Add(CoordinateOperationParameters.LongitudeOfNaturalOrigin, Angle.FromDegree(0));
            parameters.Add(CoordinateOperationParameters.FalseEasting, Length.FromMetre(0));
            parameters.Add(CoordinateOperationParameters.FalseNorthing, Length.FromMetre(0));

            _projectionPseudo = new PopularVisualisationPseudoMercatorProjection(IdentifiedObject.UserDefinedIdentifier, IdentifiedObject.UserDefinedName,
                                                                                 parameters,
                                                                                 Ellipsoid.FromSphere(String.Empty, "Sphere", 6378137),
                                                                                 AreasOfUse.World);
        }