protected void setEndDate() { String end_datetime = ds.findAttValueIgnoreCase(null, "time_coverage_end", null); if (end_datetime != null) { endDate = DateUnit.getStandardOrISO(end_datetime); } else { CoordinateAxis axis = ds.findCoordinateAxis(AxisType.Time); if (axis != null) { double val = axis.getMaxValue(); endDate = dateUnits.makeDate(val); return; } } parseInfo.append("*** end_datetime not Found\n"); }
protected void setEndDate() { String end_datetime = ds.findAttValueIgnoreCase(null, "time_coverage_end", null); if (end_datetime != null) { endDate = DateUnit.getStandardOrISO(end_datetime); } else { CoordinateAxis axis = ds.findCoordinateAxis(AxisType.Time); if (axis != null) { double val = axis.getMaxValue(); endDate = dateUnits.makeDate(val); return; } } parseInfo.append("*** end_datetime not Found\n"); }
protected void setEndDate() { String end_datetime = ds.findAttValueIgnoreCase(null, "time_coverage_end", null); if (end_datetime != null) { endDate = DateUnit.getStandardOrISO(end_datetime); } else { CoordinateAxis axis = ds.findCoordinateAxis(AxisType.Time); if (axis != null) { double val = axis.getMaxValue(); endDate = dateUnits.makeDate(val); return; } } parseInfo.append("*** end_datetime not Found\n"); }
double startLon = horizXaxis.getMinValue(); double deltaLat = horizYaxis.getMaxValue() - startLat; double deltaLon = horizXaxis.getMaxValue() - startLon;
double startLon = horizXaxis.getMinValue(); double deltaLat = horizYaxis.getMaxValue() - startLat; double deltaLon = horizXaxis.getMaxValue() - startLon;
horizXaxis.getMaxValue(), horizYaxis.getMaxValue());
horizXaxis.getMaxValue(), horizYaxis.getMaxValue());
horizXaxis.getMaxValue(), horizYaxis.getMaxValue());
private void makeBoundingBox() { // x,y may be 2D if (!(getXHorizAxis() instanceof CoordinateAxis1D) || !(getYHorizAxis() instanceof CoordinateAxis1D)) { CoordinateAxis xaxis = getXHorizAxis(); CoordinateAxis yaxis = getYHorizAxis(); /* could try to optimize this - just get cord=ners or something CoordinateAxis2D xaxis2 = (CoordinateAxis2D) horizXaxis; CoordinateAxis2D yaxis2 = (CoordinateAxis2D) horizYaxis; MAMath.MinMax */ mapArea = new ProjectionRect(xaxis.getMinValue(), yaxis.getMinValue(), xaxis.getMaxValue(), yaxis.getMaxValue()); } else { CoordinateAxis1D xaxis1 = (CoordinateAxis1D) getXHorizAxis(); CoordinateAxis1D yaxis1 = (CoordinateAxis1D) getYHorizAxis(); /* add one percent on each side if its a projection. WHY? double dx = 0.0, dy = 0.0; if (!isLatLon()) { dx = .01 * (xaxis1.getCoordEdge((int) xaxis1.getSize()) - xaxis1.getCoordEdge(0)); dy = .01 * (yaxis1.getCoordEdge((int) yaxis1.getSize()) - yaxis1.getCoordEdge(0)); } mapArea = new ProjectionRect(xaxis1.getCoordEdge(0) - dx, yaxis1.getCoordEdge(0) - dy, xaxis1.getCoordEdge((int) xaxis1.getSize()) + dx, yaxis1.getCoordEdge((int) yaxis1.getSize()) + dy); */ mapArea = new ProjectionRect(xaxis1.getCoordEdge(0), yaxis1.getCoordEdge(0), xaxis1.getCoordEdge((int) xaxis1.getSize()), yaxis1.getCoordEdge((int) yaxis1.getSize())); } }
double startLon = horizXaxis.getMinValue(); double deltaLat = horizYaxis.getMaxValue() - startLat; double deltaLon = horizXaxis.getMaxValue() - startLon;
private void makeBoundingBox() { // x,y may be 2D if (!(getXHorizAxis() instanceof CoordinateAxis1D) || !(getYHorizAxis() instanceof CoordinateAxis1D)) { CoordinateAxis xaxis = getXHorizAxis(); CoordinateAxis yaxis = getYHorizAxis(); /* could try to optimize this - just get cord=ners or something CoordinateAxis2D xaxis2 = (CoordinateAxis2D) horizXaxis; CoordinateAxis2D yaxis2 = (CoordinateAxis2D) horizYaxis; MAMath.MinMax */ mapArea = new ProjectionRect(xaxis.getMinValue(), yaxis.getMinValue(), xaxis.getMaxValue(), yaxis.getMaxValue()); } else { CoordinateAxis1D xaxis1 = (CoordinateAxis1D) getXHorizAxis(); CoordinateAxis1D yaxis1 = (CoordinateAxis1D) getYHorizAxis(); /* add one percent on each side if its a projection. WHY? double dx = 0.0, dy = 0.0; if (!isLatLon()) { dx = .01 * (xaxis1.getCoordEdge((int) xaxis1.getSize()) - xaxis1.getCoordEdge(0)); dy = .01 * (yaxis1.getCoordEdge((int) yaxis1.getSize()) - yaxis1.getCoordEdge(0)); } mapArea = new ProjectionRect(xaxis1.getCoordEdge(0) - dx, yaxis1.getCoordEdge(0) - dy, xaxis1.getCoordEdge((int) xaxis1.getSize()) + dx, yaxis1.getCoordEdge((int) yaxis1.getSize()) + dy); */ mapArea = new ProjectionRect(xaxis1.getCoordEdge(0), yaxis1.getCoordEdge(0), xaxis1.getCoordEdge((int) xaxis1.getSize()), yaxis1.getCoordEdge((int) yaxis1.getSize())); } }
static public CalendarDateRange extractCalendarDateRange(GridDataset gridDataset) { CalendarDateRange maxDateRange = null; for (GridDataset.Gridset gridset : gridDataset.getGridsets()) { GridCoordSystem gsys = gridset.getGeoCoordSystem(); CalendarDateRange dateRange; CoordinateAxis1DTime time1D = gsys.getTimeAxis1D(); if (time1D != null) { dateRange = time1D.getCalendarDateRange(); } else { CoordinateAxis time = gsys.getTimeAxis(); if (time == null) continue; try { DateUnit du = new DateUnit( time.getUnitsString()); Date minDate = du.makeDate(time.getMinValue()); Date maxDate = du.makeDate(time.getMaxValue()); dateRange = CalendarDateRange.of( minDate, maxDate); } catch (Exception e) { logger.warn("Illegal Date Unit "+time.getUnitsString()); continue; } } if (maxDateRange == null) maxDateRange = dateRange; else maxDateRange.extend( dateRange); } return maxDateRange; }
static public CalendarDateRange extractCalendarDateRange(GridDataset gridDataset) { CalendarDateRange maxDateRange = null; for (GridDataset.Gridset gridset : gridDataset.getGridsets()) { GridCoordSystem gsys = gridset.getGeoCoordSystem(); CalendarDateRange dateRange; CoordinateAxis1DTime time1D = gsys.getTimeAxis1D(); if (time1D != null) { dateRange = time1D.getCalendarDateRange(); } else { CoordinateAxis time = gsys.getTimeAxis(); if (time == null) continue; try { DateUnit du = new DateUnit( time.getUnitsString()); Date minDate = du.makeDate(time.getMinValue()); Date maxDate = du.makeDate(time.getMaxValue()); dateRange = CalendarDateRange.of( minDate, maxDate); } catch (Exception e) { logger.warn("Illegal Date Unit "+time.getUnitsString()); continue; } } if (maxDateRange == null) maxDateRange = dateRange; else maxDateRange = maxDateRange.extend( dateRange); } return maxDateRange; }
CalendarDate maxDate = du.makeCalendarDate(time.getMaxValue()); dateRange = CalendarDateRange.of(minDate, maxDate); } catch (Exception e) {
static public CalendarDateRange extractCalendarDateRange(GridDataset gridDataset) { CalendarDateRange maxDateRange = null; for (GridDataset.Gridset gridset : gridDataset.getGridsets()) { GridCoordSystem gsys = gridset.getGeoCoordSystem(); CalendarDateRange dateRange; CoordinateAxis1DTime time1D = gsys.getTimeAxis1D(); if (time1D != null) { dateRange = time1D.getCalendarDateRange(); } else { CoordinateAxis time = gsys.getTimeAxis(); if (time == null) continue; try { DateUnit du = new DateUnit( time.getUnitsString()); Date minDate = du.makeDate(time.getMinValue()); Date maxDate = du.makeDate(time.getMaxValue()); dateRange = CalendarDateRange.of( minDate, maxDate); } catch (Exception e) { logger.warn("Illegal Date Unit "+time.getUnitsString()); continue; } } if (maxDateRange == null) maxDateRange = dateRange; else maxDateRange.extend( dateRange); } return maxDateRange; }
double startLon = horizXaxis.getMinValue(); double deltaLat = horizYaxis.getMaxValue() - startLat; double deltaLon = horizXaxis.getMaxValue() - startLon;