/** * Creates a GetFeatureInfoRequest that can be configured and then passed to issueRequest(). * * @param getMapRequest a previous configured GetMapRequest * @return a GetFeatureInfoRequest * @throws UnsupportedOperationException if the server does not support GetFeatureInfo */ public GetFeatureInfoRequest createGetFeatureInfoRequest(GetMapRequest getMapRequest) { if (getCapabilities().getRequest().getGetFeatureInfo() == null) { throw new UnsupportedOperationException( "This Web Map Server does not support GetFeatureInfo requests"); } URL onlineResource = findURL(getCapabilities().getRequest().getGetFeatureInfo()); GetFeatureInfoRequest request = getSpecification().createGetFeatureInfoRequest(onlineResource, getMapRequest); return request; }
/** * Creates a GetFeatureInfoRequest that can be configured and then passed to * issueRequest(). * * @param getMapRequest a previous configured GetMapRequest * @return a GetFeatureInfoRequest * @throws UnsupportedOperationException if the server does not support GetFeatureInfo */ public GetFeatureInfoRequest createGetFeatureInfoRequest( GetMapRequest getMapRequest ) { if (getCapabilities().getRequest().getGetFeatureInfo() == null) { throw new UnsupportedOperationException("This Web Map Server does not support GetFeatureInfo requests"); } URL onlineResource = findURL(getCapabilities().getRequest().getGetFeatureInfo()); GetFeatureInfoRequest request = getSpecification().createGetFeatureInfoRequest(onlineResource, getMapRequest); return request; }
/** Returns true if the layer can be queried */ public boolean isQueryable(LayerInfo layer) { try { if (layer.getResource() instanceof WMSLayerInfo) { WMSLayerInfo info = (WMSLayerInfo) layer.getResource(); Layer wl = info.getWMSLayer(null); if (!wl.isQueryable()) { return false; } WMSCapabilities caps = info.getStore().getWebMapServer(null).getCapabilities(); OperationType featureInfo = caps.getRequest().getGetFeatureInfo(); if (featureInfo == null || !featureInfo.getFormats().contains("application/vnd.ogc.gml")) { return false; } } else if (layer.getResource() instanceof WMTSLayerInfo) { return false; } return layer.isQueryable(); } catch (IOException e) { LOGGER.log( Level.INFO, "Failed to determine if the layer is queryable, assuming it's not", e); return false; } }
info.setName(owsLayer.getName()); info.setDescription(owsLayer.getTitle()); OperationType operationTypeFeatureInfo = wmsMapServer.getCapabilities().getRequest().getGetFeatureInfo();
infoFormats = wms.getCapabilities().getRequest().getGetFeatureInfo().getFormats(); if (!infoFormats.contains("application/vnd.ogc.gml")) { return null;
info.setName(owsLayer.getName()); info.setDescription(owsLayer.getTitle()); OperationType operationTypeFeatureInfo = wmsMapServer.getCapabilities().getRequest().getGetFeatureInfo();