Geometry normalizeIfNeeded(Geometry value) { if (value instanceof Polygon) { value.normalize(); } else if (value instanceof MultiPolygon || GeometryCollection.class.equals(value.getClass())) {// ignore // multipoint/linestring normalize((GeometryCollection) value); } return value; }