visit method

void visit(
  1. Geometry geom
)
override

Implementation

void visit(Geometry geom) {
  /**
   * It may be the case that the rectangle and the
   * envelope of the geometry component are disjoint,
   * so it is worth checking this simple condition.
   */
  Envelope elementEnv = geom.getEnvelopeInternal();
  if (!rectEnv.intersectsEnvelope(elementEnv)) return;

  // check segment intersections
  // get all lines from geometry component
  // (there may be more than one if it's a multi-ring polygon)
  List lines = LinearComponentExtracter.getLines(geom);
  checkIntersectionWithLineStrings(lines);
}