locateInGeometry static method

int locateInGeometry(
  1. Coordinate p,
  2. Geometry geom
)

Implementation

static int locateInGeometry(Coordinate p, Geometry geom) {
  if (geom is Polygon) {
    return locatePointInPolygon(p, geom);
  }

  if (geom is GeometryCollection) {
    Iterator geomi = GeometryCollectionIterator(geom);
    while (geomi.moveNext()) {
      Geometry g2 = geomi.current;
      if (g2 != geom) {
        int loc = locateInGeometry(p, g2);
        if (loc != Location.EXTERIOR) return loc;
      }
    }
  }
  return Location.EXTERIOR;
}