use of org.geotools.geometry.jts.GeomCollectionIterator in project hale by halestudio.
the class StyledInstanceMarker method getPathIterator.
/**
* Returns a path iterator.
*
* @param shape a shape to determine the iterator
* @return the path iterator
*/
private PathIterator getPathIterator(final LiteShape2 shape) {
// DJB: changed this to handle multi* geometries and line and
// polygon geometries better
GeometryCollection gc;
if (shape.getGeometry() instanceof GeometryCollection)
gc = (GeometryCollection) shape.getGeometry();
else {
Geometry[] gs = new Geometry[1];
gs[0] = shape.getGeometry();
// make a Point,Line, or Poly into a GC
gc = shape.getGeometry().getFactory().createGeometryCollection(gs);
}
AffineTransform IDENTITY_TRANSFORM = new AffineTransform();
GeomCollectionIterator citer = new GeomCollectionIterator(gc, IDENTITY_TRANSFORM, false, 1.0);
return citer;
}
Aggregations