/** * Adds the geometries into the collection by recursively splitting apart geometry collections, * so that geoms will contains only simple geometries. * * @param geoms * @param geometry * @param geomType * @return the geometry type that all geometries added to the collection conform to. Worst case * it's going to be Geometry.class */ private Class accumulate(List<Geometry> geoms, Geometry geometry, Class geomType) { Class gtype = null; for (int i = 0; i < geometry.getNumGeometries(); i++) { Geometry g = geometry.getGeometryN(i); if (g instanceof GeometryCollection) { gtype = accumulate(geoms, g, geomType); } else { if (renderingEnvelope.intersects(g.getEnvelopeInternal())) { geoms.add(g); gtype = g.getClass(); } } if (gtype == null) { gtype = g.getClass(); } else if (geomType != null && !g.getClass().equals(geomType)) { gtype = Geometry.class; } } return gtype; }
geomType = accumulate(geoms, geometry, geomType); while (curr <= highLimit) { double offset = curr - base; offseted.apply(new OffsetOrdinateFilter(northEast ? 1 : 0, offset)); offseted.geometryChanged(); geomType = accumulate(geoms, offseted, geomType);
Class gtype = null; if (g instanceof GeometryCollection) { gtype = accumulate(geoms, g, geomType); } else { if(renderingEnvelope.intersects(g.getEnvelopeInternal())) {
geomType = accumulate(geoms, geometry, geomType); while (min <= highLimit) { double offset = min - env.getMinX(); offseted.apply(new OffsetOrdinateFilter(0, offset)); offseted.geometryChanged(); geomType = accumulate(geoms, offseted, geomType);