}
}
@Override
public Polygon getBuffer(double distance) {
CoordinateSequence cs = new LiteCoordinateSequence(quadrantSegments * 4 + 1, 2);
for (int i = 0; i < (cs.size() - 1); i++) {
double azimuth = 360.0 * i / cs.size() - 180;
calculator.setDirection(azimuth, distance);
Point2D dp = calculator.getDestinationGeographicPoint();
if (latLon) {
cs.setOrdinate(i, 0, dp.getY());
cs.setOrdinate(i, 1, dp.getX());
} else {
cs.setOrdinate(i, 0, dp.getX());
cs.setOrdinate(i, 1, dp.getY());
}
}
cs.setOrdinate(cs.size() - 1, 0, cs.getOrdinate(0, 0));
cs.setOrdinate(cs.size() - 1, 1, cs.getOrdinate(0, 1));
return gf.createPolygon(gf.createLinearRing(cs), null);
}