intersectsEnvelopeCoordinates method

bool intersectsEnvelopeCoordinates(
  1. Coordinate a,
  2. Coordinate b
)

Tests if the extent defined by two extremal points intersects the extent of this Envelope.

@param a a point @param b another point @return true if the extents intersect

Implementation

bool intersectsEnvelopeCoordinates(Coordinate a, Coordinate b) {
  if (isNull()) {
    return false;
  }

  double envminx = (a.x < b.x) ? a.x : b.x;
  if (envminx > _maxx) return false;

  double envmaxx = (a.x > b.x) ? a.x : b.x;
  if (envmaxx < _minx) return false;

  double envminy = (a.y < b.y) ? a.y : b.y;
  if (envminy > _maxy) return false;

  double envmaxy = (a.y > b.y) ? a.y : b.y;
  if (envmaxy < _miny) return false;

  return true;
}