/// <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)); }
/// <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; }
// 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) { }
/// <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)); }
/// <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)); }