// check each coordinate
Coordinate[] c = geom.getCoordinates();
for (int i = 0; i < c.length; i++) {
if (!xUnbounded && ((c[i].x < x.getMinimumValue()) || (c[i].x > x.getMaximumValue()))) {
throw new PointOutsideEnvelopeException(c[i].x + " outside of ("
+ x.getMinimumValue() + "," + x.getMaximumValue() + ")");
}
if (!yUnbounded && ((c[i].y < y.getMinimumValue()) || (c[i].y > y.getMaximumValue()))) {
throw new PointOutsideEnvelopeException(c[i].y + " outside of ("
+ y.getMinimumValue() + "," + y.getMaximumValue() + ")");
}
}
}