Position p;
while((p = ps.getNextPosition()) != null) {
at.setToTranslation(p.x, p.y);
at.rotate(Math.toRadians(p.rotation));
List<AffineTransform2D> transforms = new ArrayList<AffineTransform2D>();
AffineTransform2D at2d = new AffineTransform2D(at);
transforms.add(at2d);
// do we have to build the other 8 possibilities? Happens only if the
// symbol is crossing the bounds
Geometry transformed = JTS.transform(bounds, at2d);
if (tileBounds.intersects(transformed) && !tileBounds.contains(transformed)) {
for (int dx = -tileSize; dx <= tileSize; dx += tileSize) {
for (int dy = -tileSize; dy <= tileSize; dy += tileSize) {
if (dx == 0 && dy == 0) {
continue;
}
int mx = p.x + dx;
int my = p.y + dy;
at.setToTranslation(mx, my);
at.rotate(Math.toRadians(p.rotation));
AffineTransform2D tx2d = new AffineTransform2D(at);
Geometry translatedBounds = JTS.transform(bounds, tx2d);
if (tileBounds.intersects(translatedBounds)
|| tileBounds.contains(translatedBounds)) {
// System.out.println("Adding " + translatedBounds);
transforms.add(tx2d);