transformCoordinates method

CoordinateSequence transformCoordinates(
  1. CoordinateSequence coords,
  2. Geometry parent
)
override

Transforms a {@link CoordinateSequence}. This method should always return a valid coordinate list for the desired result type. (E.g. a coordinate list for a LineString must have 0 or at least 2 points). If this is not possible, return an empty sequence - this will be pruned out.

@param coords the coordinates to transform @param parent the parent geometry @return the transformed coordinates

Implementation

CoordinateSequence transformCoordinates(
    CoordinateSequence coords, Geometry parent) {
  List<Coordinate> inputPts = coords.toCoordinateArray();
  List<Coordinate> newPts;
  if (inputPts.length == 0) {
    newPts = List.empty(growable: true);
  } else {
    var simp = VWLineSimplifier(inputPts, distanceTolerance);
    newPts = simp.simplify();
  }
  return factory.getCoordinateSequenceFactory().create(newPts);
}