Class CoordinateList
A list of Coordinates, which may be set to prevent repeated coordinates from occurring in the list.
Implements
Inherited Members
Namespace: NetTopologySuite.Geometries
Assembly: NetTopologySuite.dll
Syntax
public class CoordinateList : List<Coordinate>, IList<Coordinate>, ICollection<Coordinate>, IReadOnlyList<Coordinate>, IReadOnlyCollection<Coordinate>, IEnumerable<Coordinate>, IList, ICollection, IEnumerable, ICloneable
Constructors
| Improve this Doc View SourceCoordinateList()
Constructs a new list without any coordinates
Declaration
public CoordinateList()
CoordinateList(Coordinate[])
Constructs a new list from an array of Coordinates, allowing repeated points. (I.e. this constructor produces a CoordinateList with exactly the same set of points as the input array.)
Declaration
public CoordinateList(Coordinate[] coord)
Parameters
Type | Name | Description |
---|---|---|
Coordinate[] | coord | Initial coordinates |
CoordinateList(Coordinate[], Boolean)
Constructs a new list from an array of Coordinates, allowing caller to specify if repeated points are to be removed.
Declaration
public CoordinateList(Coordinate[] coord, bool allowRepeated)
Parameters
Type | Name | Description |
---|---|---|
Coordinate[] | coord | Array of coordinates to load into the list. |
Boolean | allowRepeated | If |
CoordinateList(IList<Coordinate>)
Constructs a new list from a collection of Coordinates, allows repeated points.
Declaration
public CoordinateList(IList<Coordinate> coordList)
Parameters
Type | Name | Description |
---|---|---|
IList<Coordinate> | coordList | Collection of coordinates to load into the list. |
CoordinateList(IList<Coordinate>, Boolean)
Constructs a new list from a collection of Coordinates, allowing caller to specify if repeated points are to be removed.
Declaration
public CoordinateList(IList<Coordinate> coordList, bool allowRepeated)
Parameters
Type | Name | Description |
---|---|---|
IList<Coordinate> | coordList | Collection of coordinates to load into the list. |
Boolean | allowRepeated | If |
CoordinateList(Int32)
Constructs a new list without any coordinates but an initial capacity
Declaration
public CoordinateList(int capacity)
Parameters
Type | Name | Description |
---|---|---|
Int32 | capacity | The initial capacity of the list. |
Methods
| Improve this Doc View SourceAdd(Coordinate, Boolean)
Adds a coordinate to the end of this list.
Declaration
public bool Add(Coordinate coord, bool allowRepeated)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | coord | Coordinate to be inserted. |
Boolean | allowRepeated | If set to false, repeated coordinates are collapsed. |
Returns
Type | Description |
---|---|
Boolean | Return true if all ok. |
Add(Coordinate[], Boolean)
Adds an array of coordinates to the list.
Declaration
public bool Add(Coordinate[] coord, bool allowRepeated)
Parameters
Type | Name | Description |
---|---|---|
Coordinate[] | coord | Coordinates to be inserted. |
Boolean | allowRepeated | If set to false, repeated coordinates are collapsed. |
Returns
Type | Description |
---|---|
Boolean | Return true. |
Add(Coordinate[], Boolean, Boolean)
Adds an array of coordinates to the list.
Declaration
public bool Add(Coordinate[] coord, bool allowRepeated, bool direction)
Parameters
Type | Name | Description |
---|---|---|
Coordinate[] | coord | Coordinates to be inserted. |
Boolean | allowRepeated | If set to false, repeated coordinates are collapsed. |
Boolean | direction | If false, the array is added in reverse order. |
Returns
Type | Description |
---|---|
Boolean | Return true. |
Add(Coordinate[], Boolean, Int32, Int32)
Adds a section of an array of coordinates to the list.
Declaration
public bool Add(Coordinate[] coord, bool allowRepeated, int start, int end)
Parameters
Type | Name | Description |
---|---|---|
Coordinate[] | coord | The coordinates |
Boolean | allowRepeated | If set to false, repeated coordinates are collapsed |
Int32 | start | The index to start from |
Int32 | end | The index to add up to but not including |
Returns
Type | Description |
---|---|
Boolean | true (as by general collection contract) |
Add(Int32, Coordinate, Boolean)
Inserts the specified coordinate at the specified position in this list.
Declaration
public void Add(int i, Coordinate coord, bool allowRepeated)
Parameters
Type | Name | Description |
---|---|---|
Int32 | i | The position at which to insert |
Coordinate | coord | the coordinate to insert |
Boolean | allowRepeated | if set to false, repeated coordinates are collapsed |
Add(Object, Boolean)
Adds a coordinate to the list.
Declaration
public bool Add(object obj, bool allowRepeated)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | Coordinate to be inserted, as object. |
Boolean | allowRepeated | If set to false, repeated coordinates are collapsed. |
Returns
Type | Description |
---|---|
Boolean | Return true. |
AddAll(IEnumerable<Coordinate>, Boolean)
Add an array of coordinates.
Declaration
public bool AddAll(IEnumerable<Coordinate> coll, bool allowRepeated)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Coordinate> | coll | Coordinates collection to be inserted. |
Boolean | allowRepeated | If set to false, repeated coordinates are collapsed. |
Returns
Type | Description |
---|---|
Boolean | Return true if at least one element has added (IList not empty). |
Clone()
Returns a deep copy of this collection.
Declaration
public object Clone()
Returns
Type | Description |
---|---|
Object | The copied object. |
CloseRing()
Ensure this coordList is a ring, by adding the start point if necessary.
Declaration
public void CloseRing()
GetCoordinate(Int32)
Returns the coordinate at specified index.
Declaration
public Coordinate GetCoordinate(int i)
Parameters
Type | Name | Description |
---|---|---|
Int32 | i | Coordinate index. |
Returns
Type | Description |
---|---|
Coordinate |
ToCoordinateArray()
Returns the Coordinates in this collection.
Declaration
public Coordinate[] ToCoordinateArray()
Returns
Type | Description |
---|---|
Coordinate[] | Coordinates as |
ToCoordinateArray(Boolean)
Creates an array containing the coordinates in this list, oriented in the given direction (forward or reverse).
Declaration
public Coordinate[] ToCoordinateArray(bool isForward)
Parameters
Type | Name | Description |
---|---|---|
Boolean | isForward | The direction value: |
Returns
Type | Description |
---|---|
Coordinate[] | An oriented array of coordinates |