예제 #1
0
파일: GeoJson.cs 프로젝트: LJM74520/nice
        /// <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));
        }
예제 #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;
        }
예제 #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)
 {
 }
예제 #4
0
파일: GeoJson.cs 프로젝트: LJM74520/nice
 /// <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));
 }
예제 #5
0
파일: GeoJson.cs 프로젝트: LJM74520/nice
 /// <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));
 }