/** * Formats a dimension item into a string * * @param time */ public String format(Object o) { if (o instanceof Range) { Range range = (Range) o; return format(range.getMinValue()) + "/" + format(range.getMaxValue()); } else if (o instanceof Date) { return format((Date) o); } else { return String.valueOf(o); } }
/** * Returns the maximum time, formatted according to ISO8601 * * @throws IOException */ public String getEndTime() throws IOException { Date maxTime = accessor.getMaxTime(); return format(maxTime); }
/** * Returns the minimum time, formatted according to ISO8601 * * @throws IOException */ public String getBeginTime() throws IOException { Date minTime = accessor.getMinTime(); return format(minTime); }
/** * Encode a DateRange item as a GML TimePeriod * * @param range * @param helper * @param id */ private void encodeDateRange( final DateRange range, final WCSDimensionsHelper helper, final String id) { encodeTimePeriod( helper.format(range.getMinValue()), helper.format(range.getMaxValue()), id, null, null); }
/** * Encode a Date item as a GML TimeInstant * * @param item * @param helper * @param id */ private void encodeDate( final Date item, final WCSDimensionsHelper helper, final String id) { final AttributesImpl atts = new AttributesImpl(); atts.addAttribute("", "gml:id", "gml:id", "", id); start("gml:TimeInstant", atts); element("gml:timePosition", helper.format(item)); end("gml:TimeInstant"); }
timeDomain.stream().map(o -> helper.format(o)).collect(Collectors.toList()); throw new WCS20Exception( "Requested time subset does not intersect available values "