| | | 1 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | | 2 | | // Licensed under the MIT License. |
| | | 3 | | |
| | | 4 | | using System.Collections.Generic; |
| | | 5 | | using System.Linq; |
| | | 6 | | |
| | | 7 | | namespace Azure.Core.GeoJson |
| | | 8 | | { |
| | | 9 | | /// <summary> |
| | | 10 | | /// Represents a polygon consisting of outer ring and optional inner rings. |
| | | 11 | | /// </summary> |
| | | 12 | | public sealed class GeoPolygon : GeoObject |
| | | 13 | | { |
| | | 14 | | /// <summary> |
| | | 15 | | /// Initializes new instance of <see cref="GeoPolygon"/>. |
| | | 16 | | /// </summary> |
| | | 17 | | /// <param name="rings">The collection of rings that make up the polygon, first ring is the outer ring others ar |
| | 32 | 18 | | public GeoPolygon(IEnumerable<GeoLine> rings): this(rings, null, DefaultProperties) |
| | | 19 | | { |
| | 32 | 20 | | } |
| | | 21 | | |
| | | 22 | | /// <summary> |
| | | 23 | | /// Initializes new instance of <see cref="GeoPolygon"/>. |
| | | 24 | | /// </summary> |
| | | 25 | | /// <param name="rings">The collection of rings that make up the polygon, first ring is the outer ring others ar |
| | | 26 | | /// <param name="boundingBox">The <see cref="GeoBoundingBox"/> to use.</param> |
| | | 27 | | /// <param name="additionalProperties">The set of additional properties associated with the <see cref="GeoObject |
| | 64 | 28 | | public GeoPolygon(IEnumerable<GeoLine> rings, GeoBoundingBox? boundingBox, IReadOnlyDictionary<string, object?> |
| | | 29 | | { |
| | 64 | 30 | | Argument.AssertNotNull(rings, nameof(rings)); |
| | | 31 | | |
| | 64 | 32 | | Rings = rings.ToArray(); |
| | 64 | 33 | | } |
| | | 34 | | |
| | | 35 | | /// <summary> |
| | | 36 | | /// Gets a set of rings that form the polygon. |
| | | 37 | | /// </summary> |
| | 88 | 38 | | public IReadOnlyList<GeoLine> Rings { get; } |
| | | 39 | | } |
| | | 40 | | } |