예제 #1
0
        /// <summary>
        /// Converts shifted CH1903 / LV03 (EPSG:21781) in xy meters to WGS84 lat/lon.
        /// Inverse of LatLonToMeters.
        /// </summary>
        /// <param name="m"> A <see cref="T:UnityEngine.Vector2d"/> of coordinates in meters. </param>
        /// <returns> The <see cref="T:Mapbox.Utils.Vector2d"/> in lat/lon. </returns>
        public static Vector2d MetersToLatLon(Vector2d m)
        {
            // TODO geoAR: use LV95 instead of LV03
            double lat = 0.0, lng = 0.0, height = 0.0;

            ApproxSwissProj.LV03toWGS84(m.x + OriginLv03.X, m.y + OriginLv03.Y, 0.0, ref lat, ref lng, ref height);
            return(new Vector2d(lat, lng));
        }
예제 #2
0
        /// <summary>
        /// Converts WGS84 lat/lon to shifted CH1903 / LV03 (EPSG:21781) xy meters
        /// with origin in (0,0) instead of (600'000, 200'000).
        /// </summary>
        /// <param name="lat"> The latitude. </param>
        /// <param name="lon"> The longitude. </param>
        /// <returns> A <see cref="T:UnityEngine.Vector2d"/> of xy meters. </returns>
        public static Vector2d LatLonToMeters(double lat, double lon)
        {
            // TODO geoAR: use LV95 instead of LV03
            double east = 0.0, north = 0.0, height = 0.0;

            ApproxSwissProj.WGS84toLV03(lat, lon, 0.0, ref east, ref north, ref height);
            return(new Vector2d(east - OriginLv03.X, north - OriginLv03.Y));
        }
 public static double WGStoChNorthX(double longitude, double latitude)
 {
     return(ApproxSwissProj.WGStoCHx(latitude, longitude));
 }
 public static double WGStoChEastY(double longitude, double latitude)
 {
     return(ApproxSwissProj.WGStoCHy(latitude, longitude));
 }