transformByVectors static method

Geometry transformByVectors(
  1. Geometry g,
  2. Geometry control
)

Transforms a geometry using one to three control vectors

Implementation

static Geometry transformByVectors(Geometry g, Geometry control) {
  int nControl = control.getNumGeometries();
  List<Coordinate?> src = []..length = nControl;
  List<Coordinate?> dest = []..length = nControl;
  for (int i = 0; i < nControl; i++) {
    Geometry contComp = control.getGeometryN(i);
    List<Coordinate> pts = contComp.getCoordinates();
    src[i] = pts[0];
    dest[i] = pts[1];
  }
  AffineTransformation? trans =
      AffineTransformationFactory.createFromControlVectorsCL(src, dest);
  return trans!.transformGeom(g);
}