private static org.geotools.data.ows.Layer getLayer(WebMapServer server, int layerIndex) { return server.getCapabilities().getLayerList().get(layerIndex); }
private void setupLayersList() { caps = wms.getCapabilities(); layers.clear(); layerNames.clear(); for( Iterator i = caps.getLayerList().iterator(); i.hasNext();){ Layer layer = (Layer) i.next(); layerNames.add(layer.getTitle()); layers.add(layer); } }
private void setupLayersList() { caps = wms.getCapabilities(); layers.clear(); layerNames.clear(); for( Iterator i = caps.getLayerList().iterator(); i.hasNext();){ Layer layer = (Layer) i.next(); layerNames.add(layer.getTitle()); layers.add(layer); } }
private static org.geotools.data.ows.Layer getLayer(WebMapServer server, int layerIndex) { return server.getCapabilities().getLayerList().get(layerIndex); }
/** * Finds URL to WMS service and attempts to slice away the service parameter, since we will add * that anyway. * * @param wms * @return */ private String getWMSUrl(WebMapServer wms) { // // http://sigma.openplans.org:8080/geoserver/wms?SERVICE=WMS& String wmsUrl = wms.getCapabilities().getRequest().getGetCapabilities().getGet().toString(); int queryStart = wmsUrl.lastIndexOf("?"); if (queryStart > 0) { String preQuery = wmsUrl.substring(queryStart); if (preQuery.equalsIgnoreCase("?service=wms&")) { wmsUrl = wmsUrl.substring(0, wmsUrl.lastIndexOf("?")); } } return wmsUrl; }
private Collection<Layer> getWMSLayers(WebMapServer wms) { ArrayList<Layer> layers = new ArrayList<Layer>(); String source = wms.getInfo().getSource().toString(); String zp = _layers.get(source); // // String zp = Thinklab.get().getProperties().getProperty(WMS_LAYER_PROPERTY + "." + _wms_index); for (Layer l : WMSUtils.getNamedLayers(wms.getCapabilities())) { if (zp == null || (zp != null && zp.contains(l.getName()))) { layers.add(l); } } return layers; }
public String getTitle() { String title = layer.getTitle(); if (title != null && title.length() != 0) { return title; } else { // often the "root" layer has no title, the service title // is what is intended return getCapabilities().getService().getTitle(); } } }
public String getDescription() { String description = layer.get_abstract(); if (description != null && description.length() != 0) { return description; } else { return getCapabilities().getService().get_abstract(); } }
public PutStylesRequest createPutStylesRequest() throws UnsupportedOperationException { if (getCapabilities().getRequest().getPutStyles() == null) { throw new UnsupportedOperationException( "Server does not specify a PutStyles operation. Cannot be performed"); } URL onlineResource = getCapabilities().getRequest().getPutStyles().getGet(); if (onlineResource == null) { onlineResource = serverURL; } PutStylesRequest request = getSpecification().createPutStylesRequest(onlineResource); return request; }
public DescribeLayerRequest createDescribeLayerRequest() throws UnsupportedOperationException { if (getCapabilities().getRequest().getDescribeLayer() == null ) { throw new UnsupportedOperationException("Server does not specify a DescribeLayer operation. Cannot be performed"); } URL onlineResource = getCapabilities().getRequest().getDescribeLayer().getGet(); if (onlineResource == null) { onlineResource = serverURL; } DescribeLayerRequest request = getSpecification().createDescribeLayerRequest(onlineResource); return request; }
public DescribeLayerRequest createDescribeLayerRequest() throws UnsupportedOperationException { if (getCapabilities().getRequest().getDescribeLayer() == null) { throw new UnsupportedOperationException( "Server does not specify a DescribeLayer operation. Cannot be performed"); } URL onlineResource = getCapabilities().getRequest().getDescribeLayer().getGet(); if (onlineResource == null) { onlineResource = serverURL; } DescribeLayerRequest request = getSpecification().createDescribeLayerRequest(onlineResource); return request; }
public GetStylesRequest createGetStylesRequest() throws UnsupportedOperationException { if (getCapabilities().getRequest().getGetStyles() == null) { throw new UnsupportedOperationException( "Server does not specify a GetStyles operation. Cannot be performed"); } URL onlineResource = getCapabilities().getRequest().getGetStyles().getGet(); if (onlineResource == null) { onlineResource = serverURL; } GetStylesRequest request = getSpecification().createGetStylesRequest(onlineResource); return request; }
private void setupLayersList() { caps = wms.getCapabilities(); model.clear(); for (Layer layer :WMSUtils.getNamedLayers( caps )) { String title = layer.getTitle(); if (title == null) { title = layer.getName(); } model.addElement( layer ); } }
public GetLegendGraphicRequest createGetLegendGraphicRequest() throws UnsupportedOperationException { if (getCapabilities().getRequest().getGetLegendGraphic() == null) { throw new UnsupportedOperationException("Server does not specify a GetLegendGraphic operation. Cannot be performed"); } URL onlineResource = getCapabilities().getRequest().getGetLegendGraphic().getGet(); if (onlineResource == null) { onlineResource = serverURL; } GetLegendGraphicRequest request = getSpecification().createGetLegendGraphicRequest(onlineResource); return request; }
public GetStylesRequest createGetStylesRequest() throws UnsupportedOperationException{ if (getCapabilities().getRequest().getGetStyles() == null) { throw new UnsupportedOperationException("Server does not specify a GetStyles operation. Cannot be performed"); } URL onlineResource = getCapabilities().getRequest().getGetStyles().getGet(); if (onlineResource == null) { onlineResource = serverURL; } GetStylesRequest request = getSpecification().createGetStylesRequest(onlineResource); return request; }
public PutStylesRequest createPutStylesRequest() throws UnsupportedOperationException { if (getCapabilities().getRequest().getPutStyles() == null) { throw new UnsupportedOperationException("Server does not specify a PutStyles operation. Cannot be performed"); } URL onlineResource = getCapabilities().getRequest().getPutStyles().getGet(); if (onlineResource == null) { onlineResource = serverURL; } PutStylesRequest request = getSpecification().createPutStylesRequest(onlineResource); 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; }
public GetLegendGraphicRequest createGetLegendGraphicRequest() throws UnsupportedOperationException { if (getCapabilities().getRequest().getGetLegendGraphic() == null) { throw new UnsupportedOperationException( "Server does not specify a GetLegendGraphic operation. Cannot be performed"); } URL onlineResource = getCapabilities().getRequest().getGetLegendGraphic().getGet(); if (onlineResource == null) { onlineResource = serverURL; } GetLegendGraphicRequest request = getSpecification().createGetLegendGraphicRequest(onlineResource); return request; }
/** * Creates a GetMapRequest that can be configured and then passed to issueRequest(). * * @return a configureable GetMapRequest object */ public GetMapRequest createGetMapRequest() { URL onlineResource = findURL(getCapabilities().getRequest().getGetMap()); return (GetMapRequest) getSpecification().createGetMapRequest(onlineResource); }
/** * Creates a GetMapRequest that can be configured and then passed to * issueRequest(). * * @return a configureable GetMapRequest object */ public GetMapRequest createGetMapRequest() { URL onlineResource = findURL(getCapabilities().getRequest().getGetMap()); return (GetMapRequest) getSpecification().createGetMapRequest(onlineResource); }