/** * Writes the element if and only if the content is not null and not empty * * @param elementName * @param content */ private void elementIfNotEmpty(String elementName, String content) { if (isNotBlank(content)) element(elementName, content); } }
private void handleWGS84BoundingBox(BoundingBox envelope) { start("ows:WGS84BoundingBox"); element( "ows:LowerCorner", new StringBuilder(Double.toString(envelope.getLowerCorner().getOrdinate(0))) .append(" ") .append(envelope.getLowerCorner().getOrdinate(1)) .toString()); element( "ows:UpperCorner", new StringBuilder(Double.toString(envelope.getUpperCorner().getOrdinate(0))) .append(" ") .append(envelope.getUpperCorner().getOrdinate(1)) .toString()); end("ows:WGS84BoundingBox"); }
element("ows:Title", wcs.getTitle()); element("ows:Abstract", wcs.getAbstract()); element( "ows:ServiceType", "urn:ogc:service:wcs"); // TODO: check this: some docs specify a "OGC WCS" element("ows:ServiceTypeVersion", WCS20Const.V201); element("ows:ServiceTypeVersion", WCS20Const.V111); element("ows:ServiceTypeVersion", WCS20Const.V110); element("ows:Profile", "http://www.opengis.net/spec/WCS/2.0/conf/core"); element( "ows:Profile", "http://www.opengis.net/spec/WCS_protocol-binding_get-kvp/1.0.1"); // requirement #1 in OGC 09-147r3 element("ows:Profile", "http://www.opengis.net/spec/WCS_protocol-binding_post-xml/1.0"); element( "ows:Profile", "http://www.opengis.net/spec/WCS_service-extension_crs/1.0/conf/crs-gridded-coverage"); element( "ows:Profile", " http://www.opengis.net/spec/WCS_geotiff-coverages/1.0/conf/geotiff-coverage"); // TODO: check specs and URL element("ows:Profile", "http://www.opengis.net/spec/GMLCOV/1.0/conf/gml-coverage"); element("ows:Profile", "http://www.opengis.net/spec/GMLCOV/1.0/conf/special-format"); element("ows:Profile", "http://www.opengis.net/spec/GMLCOV/1.0/conf/multipart");
element("wcs:formatSupported", format); element("wcscrs:crsSupported", "http://www.opengis.net/def/crs/EPSG/0/" + code); element( "int:interpolationSupported", "http://www.opengis.net/def/interpolation/OGC/1/nearest-neighbor"); element( "int:interpolationSupported", "http://www.opengis.net/def/interpolation/OGC/1/linear"); element( "int:interpolationSupported", "http://www.opengis.net/def/interpolation/OGC/1/cubic");
attributes = new AttributesImpl(); attributes.addAttribute("", "xlink:href", "xlink:href", "", url); element("ows:Get", null, attributes); end("ows:HTTP"); end("ows:DCP"); start("ows:DCP"); start("ows:HTTP"); element("ows:Post", null, attributes); end("ows:HTTP"); end("ows:DCP"); start("ows:AllowedValues"); for (String value : param.getValue()) { element("ows:Value", value);
start("ows:Constraint", attributes); start("ows:AllowedValues"); element("ows:Value", "XML");
/** * Handles the service provider of the capabilities document. * * @param config The OGC service to transform. * @throws SAXException For any errors. */ private void handleServiceProvider() { start("ows:ServiceProvider"); SettingsInfo settings = wcs.getGeoServer().getSettings(); element("ows:ProviderName", settings.getContact().getContactOrganization()); AttributesImpl attributes = new AttributesImpl(); attributes.addAttribute( "", "xlink:href", "xlink:href", "", settings.getOnlineResource() != null ? settings.getOnlineResource() : ""); element("ows:ProviderSite", null, attributes); handleContact(); end("ows:ServiceProvider"); }
/** * DOCUMENT ME! * * @param kwords DOCUMENT ME! * @throws SAXException DOCUMENT ME! */ private void handleKeywords(List<KeywordInfo> kwords) { if (kwords != null && !kwords.isEmpty()) { start("ows:Keywords"); for (KeywordInfo kword : kwords) { element("ows:Keyword", kword.getValue()); } end("ows:Keywords"); } }
private void handleCoverageSummary(CoverageInfo cv) throws Exception { start("wcs:CoverageSummary"); String covId = NCNameResourceCodec.encode(cv); element("wcs:CoverageId", covId); element("wcs:CoverageSubtype", "RectifiedGridCoverage"); // TODO make this parametric handleWGS84BoundingBox(cv.getLatLonBoundingBox()); handleBoundingBox(cv.boundingBox()); end("wcs:CoverageSummary"); }