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
coord
Coordinate[]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
coord
Coordinate[]Array of coordinates to load into the list.
allowRepeated
boolIf
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
coordList
IList<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
coordList
IList<Coordinate>Collection of coordinates to load into the list.
allowRepeated
boolIf
false
, repeated points are removed.
CoordinateList(int)
Constructs a new list without any coordinates but an initial capacity
public CoordinateList(int capacity)
Parameters
capacity
intThe 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
coord
CoordinateCoordinate to be inserted.
allowRepeated
boolIf 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
coord
Coordinate[]Coordinates to be inserted.
allowRepeated
boolIf 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
coord
Coordinate[]Coordinates to be inserted.
allowRepeated
boolIf set to false, repeated coordinates are collapsed.
direction
boolIf 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
coord
Coordinate[]The coordinates
allowRepeated
boolIf set to false, repeated coordinates are collapsed
start
intThe index to start from
end
intThe 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
i
intThe position at which to insert
coord
Coordinatethe coordinate to insert
allowRepeated
boolif set to false, repeated coordinates are collapsed
Add(object, bool)
Adds a coordinate to the list.
public bool Add(object obj, bool allowRepeated)
Parameters
obj
objectCoordinate to be inserted, as object.
allowRepeated
boolIf 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
coll
IEnumerable<Coordinate>Coordinates collection to be inserted.
allowRepeated
boolIf 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
i
intCoordinate 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
isForward
boolThe direction value:
true
for forward,false
for reverse
Returns
- Coordinate[]
An oriented array of coordinates