getLocation method

int getLocation()

Gets the {@link Location} of the point relative to the ring, polygon or multipolygon from which the processed segments were provided.

This method only determines the correct location if all relevant segments must have been processed.

@return the Location of the point

Implementation

int getLocation() {
  if (isPointOnSegment) return Location.BOUNDARY;

  // The point is in the interior of the ring if the number of X-crossings is
  // odd.
  if ((crossingCount % 2) == 1) {
    return Location.INTERIOR;
  }
  return Location.EXTERIOR;
}