Пример #1
0
      /// <summary>Converts WGS to UTM coordinates.</summary>
      /// <param name="latlon">WGS Coordinate</param>
      /// <returns>UTM coordinate</returns>
      public static UtmCoordinate LatLon2UTM(Coordinate latlon) {
         if (latlon.IsDefault()) return default(UtmCoordinate);
         var xy = new GeoPoint();

         // Compute the UTM zone.
         int zone = (int)(Math.Floor(((double)latlon.Longitude + 180.0) / 6) + 1);

         xy = LatLonToUTMXY(latlon.Latitude.ToRadians(), latlon.Longitude.ToRadians(), zone);

         return new UtmCoordinate((Distance)xy.X, (Distance)xy.Y, zone, ((double)latlon.Latitude < 0.0));
      }