getCoordinates method

List<Coordinate> getCoordinates()
override

Returns an array containing the values of all the vertices for this geometry. If the geometry is a composite, the array will contain all the vertices for the components, in the order in which the components occur in the geometry.

In general, the array cannot be assumed to be the actual internal storage for the vertices. Thus modifying the array may not modify the geometry itself. Use the {@link CoordinateSequence#setOrdinate} method (possibly on the components) to modify the underlying data. If the coordinates are modified, {@link #geometryChanged} must be called afterwards.

@return the vertices of this Geometry @see #geometryChanged @see CoordinateSequence#setOrdinate

Implementation

List<Coordinate> getCoordinates() {
  return isEmpty() ? [] : [getCoordinate()!];
}