ImageExporter exporter = null;
for (CLIArguments args : argumentsGroup.getCLIArgumentsList()) {
Camera camera = null;
Projection projection = null;
if (args.isOviewTiles()) {
camera = OrthoTilesUtil.cameraForTiles(
results.getMapProjection(),
args.getOviewTiles(),
args.getOviewAngle(),
args.getOviewFrom());
projection = OrthoTilesUtil.projectionForTiles(
results.getMapProjection(),
args.getOviewTiles(),
args.getOviewAngle(),
args.getOviewFrom());
} else if (args.isOviewBoundingBox()) {
double angle = args.getOviewAngle();
CardinalDirection from = args.getOviewFrom();
Collection<VectorXZ> pointsXZ = new ArrayList<VectorXZ>();
for (LatLonEle l : args.getOviewBoundingBox()) {
pointsXZ.add(results.getMapProjection().calcPos(l.lat, l.lon));
}
AxisAlignedBoundingBoxXZ bounds =
new AxisAlignedBoundingBoxXZ(pointsXZ);
camera = OrthoTilesUtil.cameraForBounds(bounds, angle, from);
projection = OrthoTilesUtil.projectionForBounds(bounds, angle, from);
} else if (args.isPviewPos()) {
MapProjection proj = results.getMapProjection();
LatLonEle pos = args.getPviewPos();
LatLonEle lookAt = args.getPviewLookat();
camera = new Camera();
VectorXYZ posV = proj.calcPos(pos.lat, pos.lon).xyz(pos.ele);
VectorXYZ laV = proj.calcPos(lookAt.lat, lookAt.lon).xyz(lookAt.ele);
camera.setCamera(posV.x, posV.y, posV.z, laV.x, laV.y, laV.z);
projection = new Projection(false,
args.isPviewAspect() ? args.getPviewAspect() :
(double)args.getResolution().x / args.getResolution().y,
args.getPviewFovy(),