Class CoordinateList
- Namespace
- NetTopologySuite.Geometries
- Assembly
- NetTopologySuite.dll
A list of Coordinates, which may be set to prevent repeated coordinates from occurring in the list.
public class CoordinateList : List<Coordinate>, IList<Coordinate>, ICollection<Coordinate>, IList, ICollection, IReadOnlyList<Coordinate>, IReadOnlyCollection<Coordinate>, IEnumerable<Coordinate>, IEnumerable, ICloneable
- Inheritance
-
CoordinateList
- Implements
- Inherited Members
Constructors
CoordinateList()
Constructs a new list without any coordinates
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.)
public CoordinateList(Coordinate[] coord)
Parameters
coordCoordinate[]Initial coordinates
CoordinateList(Coordinate[], bool)
Constructs a new list from an array of Coordinates, allowing caller to specify if repeated points are to be removed.
public CoordinateList(Coordinate[] coord, bool allowRepeated)
Parameters
coordCoordinate[]Array of coordinates to load into the list.
allowRepeatedboolIf
false, repeated points are removed.
CoordinateList(IList<Coordinate>)
Constructs a new list from a collection of Coordinates, allows repeated points.
public CoordinateList(IList<Coordinate> coordList)
Parameters
coordListIList<Coordinate>Collection of coordinates to load into the list.
CoordinateList(IList<Coordinate>, bool)
Constructs a new list from a collection of Coordinates, allowing caller to specify if repeated points are to be removed.
public CoordinateList(IList<Coordinate> coordList, bool allowRepeated)
Parameters
coordListIList<Coordinate>Collection of coordinates to load into the list.
allowRepeatedboolIf
false, repeated points are removed.
CoordinateList(int)
Constructs a new list without any coordinates but an initial capacity
public CoordinateList(int capacity)
Parameters
capacityintThe initial capacity of the list.
Methods
Add(Coordinate, bool)
Adds a coordinate to the end of this list.
public bool Add(Coordinate coord, bool allowRepeated)
Parameters
coordCoordinateCoordinate to be inserted.
allowRepeatedboolIf set to false, repeated coordinates are collapsed.
Returns
- bool
Return true if all ok.
Add(Coordinate[], bool)
Adds an array of coordinates to the list.
public bool Add(Coordinate[] coord, bool allowRepeated)
Parameters
coordCoordinate[]Coordinates to be inserted.
allowRepeatedboolIf set to false, repeated coordinates are collapsed.
Returns
- bool
Return true.
Add(Coordinate[], bool, bool)
Adds an array of coordinates to the list.
public bool Add(Coordinate[] coord, bool allowRepeated, bool direction)
Parameters
coordCoordinate[]Coordinates to be inserted.
allowRepeatedboolIf set to false, repeated coordinates are collapsed.
directionboolIf false, the array is added in reverse order.
Returns
- bool
Return true.
Add(Coordinate[], bool, int, int)
Adds a section of an array of coordinates to the list.
public bool Add(Coordinate[] coord, bool allowRepeated, int start, int end)
Parameters
coordCoordinate[]The coordinates
allowRepeatedboolIf set to false, repeated coordinates are collapsed
startintThe index to start from
endintThe index to add up to but not including
Returns
- bool
true (as by general collection contract)
Add(int, Coordinate, bool)
Inserts the specified coordinate at the specified position in this list.
public void Add(int i, Coordinate coord, bool allowRepeated)
Parameters
iintThe position at which to insert
coordCoordinatethe coordinate to insert
allowRepeatedboolif set to false, repeated coordinates are collapsed
Add(object, bool)
Adds a coordinate to the list.
public bool Add(object obj, bool allowRepeated)
Parameters
objobjectCoordinate to be inserted, as object.
allowRepeatedboolIf set to false, repeated coordinates are collapsed.
Returns
- bool
Return true.
AddAll(IEnumerable<Coordinate>, bool)
Add an array of coordinates.
public bool AddAll(IEnumerable<Coordinate> coll, bool allowRepeated)
Parameters
collIEnumerable<Coordinate>Coordinates collection to be inserted.
allowRepeatedboolIf set to false, repeated coordinates are collapsed.
Returns
- bool
Return true if at least one element has added (IList not empty).
Clone()
Returns a deep copy of this collection.
public object Clone()
Returns
- object
The copied object.
CloseRing()
Ensure this coordList is a ring, by adding the start point if necessary.
public void CloseRing()
GetCoordinate(int)
Returns the coordinate at specified index.
public Coordinate GetCoordinate(int i)
Parameters
iintCoordinate index.
Returns
ToCoordinateArray()
Returns the Coordinates in this collection.
public Coordinate[] ToCoordinateArray()
Returns
- Coordinate[]
Coordinates as
Coordinate[]array.
ToCoordinateArray(bool)
Creates an array containing the coordinates in this list, oriented in the given direction (forward or reverse).
public Coordinate[] ToCoordinateArray(bool isForward)
Parameters
isForwardboolThe direction value:
truefor forward,falsefor reverse
Returns
- Coordinate[]
An oriented array of coordinates