Search in sources :

Example 1 with OGCService

use of gov.usgs.cida.coastalhazards.util.ogc.OGCService in project coastal-hazards by USGS-CIDA.

the class TemplateResource method makeSummary.

private Summary makeSummary(Layer layer, String attr) throws JsonSyntaxException {
    OGCService cswService = Service.ogcHelper(Service.ServiceType.csw, layer.getServices());
    log.debug("cswService {}", cswService);
    String cswEndpoint = cswService.getEndpoint();
    log.debug("cswEndpoint {}", cswEndpoint);
    String summaryJson = null;
    try {
        summaryJson = MetadataUtil.getSummaryFromWPS(cswEndpoint, attr);
        log.debug("summaryJsonMetadataUtil {}", summaryJson);
    } catch (IOException | ParserConfigurationException | SAXException | URISyntaxException ex) {
        log.error("Problem getting summary from item", ex);
    }
    Gson gson = GsonUtil.getDefault();
    log.debug(String.valueOf(gson));
    Summary summary = gson.fromJson(summaryJson, Summary.class);
    log.debug(String.valueOf(summary));
    return summary;
}
Also used : OGCService(gov.usgs.cida.coastalhazards.util.ogc.OGCService) Gson(com.google.gson.Gson) Summary(gov.usgs.cida.coastalhazards.model.summary.Summary) IOException(java.io.IOException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) URISyntaxException(java.net.URISyntaxException) SAXException(org.xml.sax.SAXException)

Example 2 with OGCService

use of gov.usgs.cida.coastalhazards.util.ogc.OGCService in project coastal-hazards by USGS-CIDA.

the class Item method fetchWfsService.

public WFSService fetchWfsService() {
    WFSService wfsService = null;
    OGCService ogc = fetchOgcService(ServiceType.proxy_wfs);
    if (ogc instanceof WFSService) {
        wfsService = (WFSService) ogc;
    }
    return wfsService;
}
Also used : OGCService(gov.usgs.cida.coastalhazards.util.ogc.OGCService) WFSService(gov.usgs.cida.coastalhazards.util.ogc.WFSService)

Example 3 with OGCService

use of gov.usgs.cida.coastalhazards.util.ogc.OGCService in project coastal-hazards by USGS-CIDA.

the class Item method fetchCswService.

public CSWService fetchCswService() {
    CSWService cswService = null;
    OGCService ogc = fetchOgcService(ServiceType.csw);
    if (ogc instanceof CSWService) {
        cswService = (CSWService) ogc;
    }
    return cswService;
}
Also used : CSWService(gov.usgs.cida.coastalhazards.util.ogc.CSWService) OGCService(gov.usgs.cida.coastalhazards.util.ogc.OGCService)

Example 4 with OGCService

use of gov.usgs.cida.coastalhazards.util.ogc.OGCService in project coastal-hazards by USGS-CIDA.

the class Item method fetchWmsService.

/**
 * Get the WMSService to display from the services
 *
 * @return
 */
public WMSService fetchWmsService() {
    WMSService wmsService = null;
    OGCService ogc = fetchOgcService(ServiceType.proxy_wms);
    if (ogc instanceof WMSService) {
        wmsService = (WMSService) ogc;
    }
    return wmsService;
}
Also used : WMSService(gov.usgs.cida.coastalhazards.util.ogc.WMSService) OGCService(gov.usgs.cida.coastalhazards.util.ogc.OGCService)

Aggregations

OGCService (gov.usgs.cida.coastalhazards.util.ogc.OGCService)4 Gson (com.google.gson.Gson)1 Summary (gov.usgs.cida.coastalhazards.model.summary.Summary)1 CSWService (gov.usgs.cida.coastalhazards.util.ogc.CSWService)1 WFSService (gov.usgs.cida.coastalhazards.util.ogc.WFSService)1 WMSService (gov.usgs.cida.coastalhazards.util.ogc.WMSService)1 IOException (java.io.IOException)1 URISyntaxException (java.net.URISyntaxException)1 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)1 SAXException (org.xml.sax.SAXException)1