/** * 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"); }
element("gml:low", lowSb.toString().trim()); element("gml:high", highSb.toString().trim()); end("gml:GridEnvelope"); element("gml:axisLabels", "i j"); start("gml:origin"); start("gml:Point", pointAttr); element( "gml:pos", axesSwap element( "gml:offsetVector", Double.valueOf(axesSwap ? g2W.getShearX() : g2W.getScaleX()) + Double.valueOf(axesSwap ? g2W.getScaleX() : g2W.getShearX()), offsetAttr); element( "gml:offsetVector", Double.valueOf(axesSwap ? g2W.getScaleY() : g2W.getShearY())
for (Object item : domain) { if (item instanceof Number) { element(TAG.SINGLE_VALUE, item.toString()); } else if (item instanceof NumberRange) { NumberRange range = (NumberRange) item;
"", "http://www.opengis.net/def/nil/OGC/0/unknown"); element("swe:nilValue", String.valueOf(nodata), nodataAttr); "", "http://www.opengis.net/def/nil/OGC/0/unknown"); element("swe:nilValue", nodata, nodataAttr); } else { "", "http://www.opengis.net/def/nil/OGC/0/unknown"); element("swe:nilValue", nodata.toString(), nodataAttr);
/** * 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"); }
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"); }