Search in sources :

Example 1 with MetadataURL

use of org.geotools.data.wms.xml.MetadataURL in project spatial-portal by AtlasOfLivingAustralia.

the class AddWMSLayerComposer method makeMetadataHtml.

String makeMetadataHtml(Layer layer) {
    StringBuilder sb = new StringBuilder();
    sb.append("<html>");
    sb.append("<br>name: ").append(layer.getName());
    sb.append("<br>");
    sb.append("title: ").append(layer.getTitle());
    sb.append("<br>");
    sb.append("abstract: ").append(layer.get_abstract());
    sb.append("<br>");
    sb.append("keywords: ");
    if (layer.getKeywords() != null) {
        for (String s : layer.getKeywords()) {
            sb.append(s).append(", ");
        }
    }
    if (layer.getMetadataURL() != null && !layer.getMetadataURL().isEmpty()) {
        sb.append("<br>");
        sb.append("metadata URL: ");
        for (MetadataURL url : layer.getMetadataURL()) {
            sb.append("<a target='_blank' href='").append(url.getUrl().toString().replace("'", "''")).append("'>").append(StringEscapeUtils.escapeHtml(url.getUrl().toString())).append("</a>, ");
        }
    }
    sb.append("<br>");
    String bbox = layer.getLatLonBoundingBox().getMinX() + " " + layer.getLatLonBoundingBox().getMinY() + "," + layer.getLatLonBoundingBox().getMaxX() + " " + layer.getLatLonBoundingBox().getMaxY();
    sb.append("bounding box: ").append(bbox);
    sb.append("</html>");
    return sb.toString();
}
Also used : MetadataURL(org.geotools.data.wms.xml.MetadataURL)

Aggregations

MetadataURL (org.geotools.data.wms.xml.MetadataURL)1