Пример #1
0
        private void Initialize(double latitude, double longitude)
        {
            CoordinatesUtil.validateLatitude(latitude);
            CoordinatesUtil.validateLongitude(longitude);

            this.Latitude  = latitude;
            this.Longitude = longitude;
        }
Пример #2
0
 /// <summary>
 /// Creates a new GeoPoint from a comma-separated string of coordinates in the order latitude, longitude. All coordinate values must be in degrees.
 /// </summary>
 /// <param name="GeoPointstring">the string that describes the GeoPoint</param>
 /// <returns>a new GeoPoint with the given coordinates</returns>
 /// <exception cref="ArgumentException">if the string cannot be parsed or describes an invalid GeoPoint</exception>
 public static GeoPoint Parse(string GeoPointstring)
 {
     double[] coordinates = CoordinatesUtil.parseCoordinatestring(GeoPointstring, 2);
     return(new GeoPoint(coordinates[0], coordinates[1]));
 }
Пример #3
0
 /**
  * Creates a new BoundingBox from a comma-separated string of coordinates in the order minLat, minLon, maxLat,
  * maxLon. All coordinate values must be in degrees.
  *
  * @param boundingBoxstring
  *            the string that describes the BoundingBox.
  * @return a new BoundingBox with the given coordinates.
  * @throws IllegalArgumentException
  *             if the string cannot be parsed or describes an invalid BoundingBox.
  */
 public static BoundingBox FromString(string boundingBoxstring)
 {
     double[] coordinates = CoordinatesUtil.parseCoordinatestring(boundingBoxstring, 4);
     return(new BoundingBox(coordinates[0], coordinates[1], coordinates[2], coordinates[3]));
 }