/** * Encode a GML time period * * @param beginPosition * @param endPosition * @param timePeriodId * @param intervalUnit * @param intervalValue */ public void encodeTimePeriod( String beginPosition, String endPosition, String timePeriodId, String intervalUnit, Long intervalValue) { AttributesImpl atts = new AttributesImpl(); atts.addAttribute("", "gml:id", "gml:id", "", timePeriodId); start("gml:TimePeriod", atts); element("gml:beginPosition", beginPosition); element("gml:endPosition", endPosition); if (intervalUnit != null && intervalValue != null) { atts = new AttributesImpl(); atts.addAttribute("", "unit", "unit", "", intervalUnit); element("gml:timeInterval", intervalValue.toString(), atts); } end("gml:TimePeriod"); }
/** * Encode Interval * * @param beginPosition * @param endPosition * @param dimensionId */ public void encodeInterval( String beginPosition, String endPosition, String intervalUnit, Double intervalValue) { AttributesImpl atts = new AttributesImpl(); start(TAG.RANGE, atts); element(TAG.INTERVAL_START, beginPosition); element(TAG.INTERVAL_END, endPosition); if (intervalUnit != null && intervalValue != null) { atts = new AttributesImpl(); atts.addAttribute("", "unit", "unit", "", intervalUnit); element(TAG.INTERVAL_PERIOD, intervalValue.toString(), atts); } end(TAG.RANGE); } /**
/** * 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"); }
gridAttrs.addAttribute("", "dimension", "dimension", "", String.valueOf(gridDimension)); start("gml:domainSet"); start("gml:RectifiedGrid", gridAttrs); start("gml:limits"); start("gml:GridEnvelope"); element("gml:low", lowSb.toString().trim()); element("gml:high", highSb.toString().trim()); pointAttr.addAttribute("", "gml:id", "gml:id", "", "p00_" + gcName); pointAttr.addAttribute("", "srsName", "srsName", "", srsName); start("gml:origin"); start("gml:Point", pointAttr); element( "gml:pos",
start("gml:RectifiedGridCoverage", attributes);
start("gml:rangeType"); start("swe:DataRecord"); sd.getDescription() start("swe:field", fieldAttr); start("swe:Quantity"); start("swe:description"); "", uom == null ? "W.m-2.Sr-1" : SimpleUnitFormat.getInstance().format(uom)); start("swe:uom", uomAttr); end("swe:uom"); start("swe:constraint"); start("swe:AllowedValues");
initStartMetadataTag(TAG.ADDITIONAL_DIMENSION, name, dimension, helper); start(startTag);
final DimensionInfo timeDimension = helper.getTimeDimension(); if (timeDimension != null) { start(initStartMetadataTag(TAG.TIME_DOMAIN, null, timeDimension, helper)); final DimensionPresentation presentation = timeDimension.getPresentation(); final String id = helper.getCoverageId();
start(initStartMetadataTag(TAG.ELEVATION_DOMAIN, null, elevationDimension, helper)); final DimensionPresentation presentation = elevationDimension.getPresentation(); switch (presentation) {
/** * Encode the coverage function or better the GridFunction as per clause 19.3.12 of GML * 3.2.1 which helps us with indicating in which way we traverse the data. * * <p>Notice that we use the axisOrder to actually <strong>always</strong> encode data il * easting,northing, hence in case of a northing,easting crs we use a reversed order to * indicate that we always walk on the raster columns first. * * <p>In cases where the coordinates increases in the opposite order ho our walk the * offsetVectors of the RectifiedGrid will do the rest. * * @param gc2d * @param axisSwap */ public void handleCoverageFunction(GridEnvelope2D gridRange, boolean axisSwap) { start("gml:coverageFunction"); start("gml:GridFunction"); // build the fragment final AttributesImpl gridAttrs = new AttributesImpl(); gridAttrs.addAttribute("", "axisOrder", "axisOrder", "", axisSwap ? "+2 +1" : "+1 +2"); element("gml:sequenceRule", "Linear", gridAttrs); // minOccurs 0, default Linear element( "gml:startPoint", gridRange.x + " " + gridRange.y); // we start at minx, miny (this is optional though) end("gml:GridFunction"); end("gml:coverageFunction"); }
/** * Encode the interval range * * @param range */ private boolean setRange(NumberRange<? extends Number> range) { if (range != null && !Double.isInfinite(range.getMaximum()) && !Double.isInfinite(range.getMinimum())) { start("swe:interval"); chars(range.getMinValue() + " " + range.getMaxValue()); end("swe:interval"); return true; } return false; }
private void encodeFileReference(FileReference fileReference) { start("gml:File"); final AttributesImpl atts = new AttributesImpl(); atts.addAttribute("", "xlink:arcrole", "xlink:arcrole", "", "fileReference"); atts.addAttribute( "", "xlink:href", "xlink:href", "", "cid:" + fileReference.getReference()); atts.addAttribute( "", "xlink:role", "xlink:role", "", fileReference.getConformanceClass()); element("gml:rangeParameters", "", atts); element("gml:fileReference", "cid:" + fileReference.getReference()); element("gml:fileStructure", ""); element("gml:mimeType", fileReference.getMimeType()); end("gml:File"); }
/** * Encodes the Range as per the GML spec of the provided {@link GridCoverage2D} * * @param gc2d the {@link GridCoverage2D} for which to encode the Range. */ public void handleRange(GridCoverage2D gc2d) { // preamble start("gml:rangeSet"); if (fileReference != null) { encodeFileReference(fileReference); } else { encodeAsDataBlocks(gc2d); } end("gml:rangeSet"); }