Esempio n. 1
0
        /// <summary>
        /// Creates a GeoJson Polygon object.
        /// </summary>
        /// <typeparam name="TCoordinates">The type of the coordinates.</typeparam>
        /// <param name="positions">The positions.</param>
        /// <returns>A GeoJson Polygon object.</returns>
        public static GeoJsonPolygon <TCoordinates> Polygon <TCoordinates>(params TCoordinates[] positions) where TCoordinates : GeoJsonCoordinates
        {
            var exterior    = new GeoJsonLinearRingCoordinates <TCoordinates>(positions);
            var coordinates = new GeoJsonPolygonCoordinates <TCoordinates>(exterior);

            return(new GeoJsonPolygon <TCoordinates>(coordinates));
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="GeoJsonPolygon{TCoordinates}"/> class.
        /// </summary>
        /// <param name="args">The additional args.</param>
        /// <param name="coordinates">The coordinates.</param>
        public GeoJsonPolygon(GeoJsonObjectArgs <TCoordinates> args, GeoJsonPolygonCoordinates <TCoordinates> coordinates)
            : base(args)
        {
            if (coordinates == null)
            {
                throw new ArgumentNullException("coordinates");
            }

            _coordinates = coordinates;
        }
Esempio n. 3
0
 // constructors
 /// <summary>
 /// Initializes a new instance of the <see cref="GeoJsonPolygon{TCoordinates}"/> class.
 /// </summary>
 /// <param name="coordinates">The coordinates.</param>
 public GeoJsonPolygon(GeoJsonPolygonCoordinates <TCoordinates> coordinates)
     : this(null, coordinates)
 {
 }
Esempio n. 4
0
 /// <summary>
 /// Creates a GeoJson Polygon object.
 /// </summary>
 /// <typeparam name="TCoordinates">The type of the coordinates.</typeparam>
 /// <param name="coordinates">The coordinates.</param>
 /// <returns>A GeoJson Polygon object.</returns>
 public static GeoJsonPolygon <TCoordinates> Polygon <TCoordinates>(GeoJsonPolygonCoordinates <TCoordinates> coordinates) where TCoordinates : GeoJsonCoordinates
 {
     return(new GeoJsonPolygon <TCoordinates>(coordinates));
 }
Esempio n. 5
0
 /// <summary>
 /// Creates a GeoJson Polygon object.
 /// </summary>
 /// <typeparam name="TCoordinates">The type of the coordinates.</typeparam>
 /// <param name="args">The additional args.</param>
 /// <param name="coordinates">The coordinates.</param>
 /// <returns>A GeoJson Polygon object.</returns>
 public static GeoJsonPolygon <TCoordinates> Polygon <TCoordinates>(GeoJsonObjectArgs <TCoordinates> args, GeoJsonPolygonCoordinates <TCoordinates> coordinates) where TCoordinates : GeoJsonCoordinates
 {
     return(new GeoJsonPolygon <TCoordinates>(args, coordinates));
 }