Exemple #1
0
 public GeographicHeightCoordinate TransformValue(GeographicHeightCoordinate value)
 {
     return(new GeographicHeightCoordinate(
                _core.TransformValue(value.Latitude),
                _core.TransformValue(value.Longitude),
                value.Height));
 }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="value">Coordinates in decimal degrees.</param>
        /// <returns>result in decimal degrees.</returns>
        public GeographicCoordinate TransformValue(GeographicHeightCoordinate value)
        {
            var dLat = A0 + (A1 * value.Latitude) + (A2 * value.Longitude) + (A3 * value.Height);
            var dLon = _b0Total + (B1 * value.Latitude) + (B2 * value.Longitude) + (B3 * value.Height);

            // be sure to convert the delta from arc-seconds to degrees
            return(new GeographicCoordinate(value.Latitude + (dLat / 3600.0), value.Longitude + (dLon / 3600.0)));
        }
        public void EpsgExample221InverseTest()
        {
            var transform = new GeographicGeocentricTransformation(new SpheroidEquatorialInvF(6378137.000, 298.2572236));
            var inputValue = new Point3(3771793.968, 140253.342, 5124304.349);
            var expected = new GeographicHeightCoordinate(0.939151102, 0.037167659, 73);

            var result = (transform.GetInverse() as ITransformation<Point3, GeographicCoordinate>).TransformValue(inputValue);

            Assert.AreEqual(expected.Latitude, result.Latitude, 0.0000000006);
            Assert.AreEqual(expected.Longitude, result.Longitude, 0.0000000002);
        }
Exemple #4
0
        public void EpsgExample221InverseTest()
        {
            var transform  = new GeographicGeocentricTransformation(new SpheroidEquatorialInvF(6378137.000, 298.2572236));
            var inputValue = new Point3(3771793.968, 140253.342, 5124304.349);
            var expected   = new GeographicHeightCoordinate(0.939151102, 0.037167659, 73);

            var result = (transform.GetInverse() as ITransformation <Point3, GeographicCoordinate>).TransformValue(inputValue);

            Assert.AreEqual(expected.Latitude, result.Latitude, 0.0000000006);
            Assert.AreEqual(expected.Longitude, result.Longitude, 0.0000000002);
        }
Exemple #5
0
        public void EpsgExample221Test()
        {
            var transform  = new GeographicGeocentricTransformation(new SpheroidEquatorialInvF(6378137.000, 298.2572236));
            var expected   = new Point3(3771793.968, 140253.342, 5124304.349);
            var inputValue = new GeographicHeightCoordinate(0.939151102, 0.037167659, 73);

            var result = transform.TransformValue(inputValue);

            Assert.AreEqual(expected.X, result.X, 0.003);
            Assert.AreEqual(expected.Y, result.Y, 0.0006);
            Assert.AreEqual(expected.Z, result.Z, 0.003);
        }
        public void EpsgExample221Test()
        {
            var transform = new GeographicGeocentricTransformation(new SpheroidEquatorialInvF(6378137.000, 298.2572236));
            var expected = new Point3(3771793.968, 140253.342, 5124304.349);
            var inputValue = new GeographicHeightCoordinate(0.939151102, 0.037167659, 73);

            var result = transform.TransformValue(inputValue);

            Assert.AreEqual(expected.X, result.X, 0.003);
            Assert.AreEqual(expected.Y, result.Y, 0.0006);
            Assert.AreEqual(expected.Z, result.Z, 0.003);
        }
Exemple #7
0
        private static bool TryCreateGeographicHeightCoordinate(INamedParameter latParam, INamedParameter lonParam, INamedParameter heightParam, IUnit angularUnit, IUnit linearUnit, out GeographicHeightCoordinate result)
        {
            double lat, lon, h;

            if (TryGetDouble(latParam, angularUnit, out lat) | TryGetDouble(lonParam, angularUnit, out lon) | TryGetDouble(heightParam, linearUnit, out h))
            {
                result = new GeographicHeightCoordinate(lat, lon, h);
                return(true);
            }
            result = GeographicHeightCoordinate.Invalid;
            return(false);
        }
Exemple #8
0
        public Point3 TransformValue(GeographicHeightCoordinate geographic)
        {
            var sinLatitude = Math.Sin(geographic.Latitude);
            var v           = MajorAxis / Math.Sqrt(
                1.0 - (ESq * sinLatitude * sinLatitude)
                );
            var vHeightCostLatitude = (v + geographic.Height) * Math.Cos(geographic.Latitude);

            return(new Point3(
                       vHeightCostLatitude * Math.Cos(geographic.Longitude),
                       vHeightCostLatitude * Math.Sin(geographic.Longitude),
                       ((OneMinusESq * v) + geographic.Height) * sinLatitude
                       ));
        }
        public void EpsgExample2442InverseTest()
        {
            var transform = new AbridgedMolodenskyTransformation(
                new Vector3(84.87, 96.49, 116.95),
                new SpheroidEquatorialInvF(6378137.0, 298.2572236),
                new SpheroidEquatorialInvF(6378388.0, 297.0)
                );
            var s = new GeographicHeightCoordinate(0.939151102, 0.037167659, 73);
            var t = new GeographicHeightCoordinate(0.93916441, 0.03719237, 28.02);

            var result = transform.GetInverse().TransformValue(t);

            Assert.AreEqual(s.Latitude, result.Latitude, 0.000003);
            Assert.AreEqual(s.Longitude, result.Longitude, 0.000005);
            Assert.AreEqual(s.Height, result.Height, 0.08);
        }
        public void EpsgExample2442Test()
        {
            var transform = new AbridgedMolodenskyTransformation(
                new Vector3(84.87, 96.49, 116.95),
                new SpheroidEquatorialInvF(6378137.0, 298.2572236),
                new SpheroidEquatorialInvF(6378388.0, 297.0)
            );
            var s = new GeographicHeightCoordinate(0.939151102, 0.037167659, 73);
            var t = new GeographicHeightCoordinate(0.93916441, 0.03719237, 28.02);

            var result = transform.TransformValue(s);

            Assert.AreEqual(t.Latitude, result.Latitude, 0.000005);
            Assert.AreEqual(t.Longitude, result.Longitude, 0.000005);
            Assert.AreEqual(t.Height, result.Height, 0.08);
        }
Exemple #11
0
 public abstract GeographicCoordinate TransformValue2D(GeographicHeightCoordinate value);
Exemple #12
0
 public override GeographicCoordinate TransformValue2D(GeographicHeightCoordinate value)
 {
     return(GeocentricToGeographic.TransformValue2D(_mbInverse.TransformValue(GeographicToGeocentric.TransformValue(value))));
 }
Exemple #13
0
 public override GeographicCoordinate TransformValue2D(GeographicHeightCoordinate value)
 {
     return(GeocentricToGeographic.TransformValue2D(MolodenskyBadekas.TransformValue(GeographicToGeocentric.TransformValue(value))));
 }
 public override GeographicHeightCoordinate TransformValue(GeographicHeightCoordinate value)
 {
     return(GeocentricToGeographic.TransformValue(_inverseOperation.TransformValue(GeographicToGeocentric.TransformValue(value))));
 }
Exemple #15
0
 public override GeographicCoordinate TransformValue2D(GeographicHeightCoordinate value)
 {
     return(GeocentricToGeographic.TransformValue2D(GeographicToGeocentric.TransformValue(value).Add(Delta)));
 }
Exemple #16
0
 public GeographicHeightCoordinate TransformValue(GeographicHeightCoordinate value)
 {
     return(new GeographicHeightCoordinate(value.Latitude, value.Longitude, value.Height + _offset));
 }
Exemple #17
0
 public GeographicOffset(GeographicHeightCoordinate delta)
 {
     _delta = delta;
 }
Exemple #18
0
 public Point2 TransformValue(GeographicHeightCoordinate value)
 {
     return(new Point2(value.Longitude, value.Latitude));
 }
 public override GeographicCoordinate TransformValue2D(GeographicHeightCoordinate value)
 {
     return GeocentricToGeographic.TransformValue2D(GeographicToGeocentric.TransformValue(value).Add(Delta));
 }
Exemple #20
0
 GeographicCoordinate ITransformation <GeographicHeightCoordinate, GeographicCoordinate> .TransformValue(GeographicHeightCoordinate value)
 {
     return(TransformValue2D(value));
 }
 private static bool TryCreateGeographicHeightCoordinate(INamedParameter latParam, INamedParameter lonParam, INamedParameter heightParam, IUnit angularUnit, IUnit linearUnit, out GeographicHeightCoordinate result)
 {
     double lat, lon, h;
     if (TryGetDouble(latParam, angularUnit, out lat) | TryGetDouble(lonParam, angularUnit, out lon) | TryGetDouble(heightParam, linearUnit, out h)) {
         result = new GeographicHeightCoordinate(lat, lon, h);
         return true;
     }
     result = GeographicHeightCoordinate.Invalid;
     return false;
 }
 public override GeographicHeightCoordinate TransformValue(GeographicHeightCoordinate value)
 {
     return GeocentricToGeographic.TransformValue(_inverseOperation.TransformValue(GeographicToGeocentric.TransformValue(value)));
 }
 public override GeographicCoordinate TransformValue2D(GeographicHeightCoordinate value)
 {
     return GeocentricToGeographic.TransformValue2D(_mbInverse.TransformValue(GeographicToGeocentric.TransformValue(value)));
 }
Exemple #24
0
 GeographicCoordinate ITransformation <GeographicHeightCoordinate, GeographicCoordinate> .TransformValue(GeographicHeightCoordinate value)
 {
     return(new GeographicCoordinate(value.Latitude + Delta.Latitude, value.Longitude + Delta.Longitude));
 }
 public override GeographicCoordinate TransformValue2D(GeographicHeightCoordinate value)
 {
     return GeocentricToGeographic.TransformValue2D(MolodenskyBadekas.TransformValue(GeographicToGeocentric.TransformValue(value)));
 }
Exemple #26
0
 private void TransformValue(ref GeographicHeightCoordinate value)
 {
     value = new GeographicHeightCoordinate(value.Latitude + Delta.Latitude, value.Longitude + Delta.Longitude, value.Height + Delta.Height);
 }