private OGCGeometry simplifyBunch_(GeometryCursor gc) {
// Combines geometries into multipoint, polyline, and polygon types,
// simplifying them and unioning them,
// then produces OGCGeometry from the result.
// Can produce OGCConcreteGoemetryCollection
MultiPoint dstMultiPoint = null;
ArrayList<Geometry> dstPolylines = new ArrayList<Geometry>();
ArrayList<Geometry> dstPolygons = new ArrayList<Geometry>();
for (com.esri.core.geometry.Geometry g = gc.next(); g != null; g = gc
.next()) {
switch (g.getType()) {
case Point:
if (dstMultiPoint == null)
dstMultiPoint = new MultiPoint();
dstMultiPoint.add((Point) g);
break;
case MultiPoint:
if (dstMultiPoint == null)
dstMultiPoint = new MultiPoint();
dstMultiPoint.add((MultiPoint) g, 0, -1);
break;
case Polyline:
dstPolylines.add((Polyline) g.copy());
break;
case Polygon: