GridCoordSystem gcsMax = null;
LatLonRect llbbMax = null;
LatLonRect llbb = null;
DateRange dateRange = null;
long nx = 0, ny = 0;
for (GridDataset.Gridset gset : gridDs.getGridsets()) {
GridCoordSystem gcs = gset.getGeoCoordSystem();
CoordinateAxis1D xaxis = (CoordinateAxis1D) gcs.getXHorizAxis();
CoordinateAxis1D yaxis = (CoordinateAxis1D) gcs.getYHorizAxis();
long nx2 = xaxis.getSize();
long ny2 = yaxis.getSize();
if ((nx != nx2) || (ny != ny2)) {
nx = nx2;
ny = ny2;
double dx = xaxis.getIncrement();
double dy = yaxis.getIncrement();
out.println(" horizontal = " + nx + " by " + ny + " points, resolution " + Format.d(dx, 4) + " " + Format.d(dy, 4)
+ " " + xaxis.getUnitsString());
}
ProjectionImpl proj = gcs.getProjection();
if (proj != null) {
out.println(", " + proj.getClassName() + " projection;");
List<Parameter> params = proj.getProjectionParameters();
for (Parameter p : params)
out.println(" " + p.getName() + " " + p.getStringValue());
} else
out.println();
LatLonRect llbb2 = gcs.getLatLonBoundingBox();
if ((llbb == null) || !llbb2.equals(llbb)) {
llbb = llbb2;
if (llbbMax == null)
llbbMax = llbb;
else
llbbMax.extend(llbb);
if (llbb.getWidth() >= 360.0) {
out.println(" BoundingBox == GLOBAL");
} else {
StringBuffer buff = new StringBuffer();
LatLonPointImpl ll = llbb.getLowerLeftPoint();
LatLonPointImpl ur = llbb.getUpperRightPoint();
buff.append(Double.toString(ll.getLongitude()));
buff.append(" ");
buff.append(Double.toString(ll.getLatitude()));
buff.append(" ");
buff.append(Double.toString(ur.getLongitude()));
buff.append(" ");
buff.append(Double.toString(ur.getLatitude()));
buff.append(" ");
out.println(" BoundingBox == " + llbb + " width= " + llbb.getWidth() + " " + (llbb.getWidth() >= 360.0 ? "global" : ""));
}
}
CoordinateAxis1DTime taxis = gcs.getTimeAxis1D();
DateRange dateRange2 = gcs.getDateRange();
if ((taxis != null) && ((dateRange == null) || !dateRange2.equals(dateRange))) {
long ntimes = taxis.getSize();
try {
TimeUnit tUnit = taxis.getTimeResolution();
dateRange = new DateRange(dateRange2, "1 hour");
out.println(" DateRange == " + "start= " + dateRange.getStart() + " end= " + dateRange.getEnd() +
" duration= " + dateRange.getDuration() + " ntimes = " + ntimes + " data resolution = " + tUnit);
} catch (Exception e) {
e.printStackTrace();
}