public class WMSQueryLayers extends QueryLayers
Concrete class extending the QueryLayers abstract class, providing an implementation for querying a WMS server's GetCapabilities operation.
WMS layers may form a tree structure. Non-leaf nodes may be displayable as layers in their own right, or not. The layer metadata this class provides is returned in a recursive structure to represent that tree. The Layer.isDisplayable() method may be called to determine if a layer is a displayable layer, rather than just a "container" layer.
The WMS specification can be found here: http://cite.opengeospatial.org/teamengine/about/wms/1.1.1/site/ and http://cite.opengeospatial.org/teamengine/about/wms/1.3.0/site/
QueryLayers.Style
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
TAG |
baseURL, getMapURL, isProcessed, layers, mimeTypes, serviceTitle
Constructor and Description |
---|
WMSQueryLayers(java.lang.String baseURLStr)
Create a new WMSQueryLayers object with the given URL string that points to a WMS server.
|
WMSQueryLayers(java.net.URL baseURL)
Create a new WMSQueryLayers object with the given URL that points to a WMS server.
|
Modifier and Type | Method and Description |
---|---|
static WebMapLayer |
constructAggregate(java.lang.String title,
java.util.List<WebMapLayer> layers)
Responsible for producing an aggregate WebMapLayer
Tested with: https://geoint.nrlssc.navy.mil/maritime/wms?REQUEST=GetCapabilities&VERSION=1.3.0&SERVICE=WMS
|
void |
process()
Actually perform the query of the map server.
|
getBaseURL, getGetMapURL, getLayers, getMimeTypes, getServiceTitle, isProcessed
public static final java.lang.String TAG
public WMSQueryLayers(java.lang.String baseURLStr)
Create a new WMSQueryLayers object with the given URL string that points to a WMS server. baseURLStr may be missing the protocol, in which case HTTP is assumed and "http://" will be pre-pended to the URL string.
No processing or network access is done at this time except for URL syntax validation; process() must be called to actually query the WMS.baseURLStr
- the URL of the WMS server.java.lang.IllegalArgumentException
- if baseURLStr is not a valid URL, the above protocol
exception notwithstanding.public WMSQueryLayers(java.net.URL baseURL)
Create a new WMSQueryLayers object with the given URL that points to a WMS server.
No processing or network access is done at this time except for URL syntax validation; process() must be called to actually query the WMS.baseURL
- the URL of the WMS server.public void process() throws java.io.IOException
QueryLayers
process
in class QueryLayers
java.io.IOException
- in case of error.public static WebMapLayer constructAggregate(java.lang.String title, java.util.List<WebMapLayer> layers)
title
- supplied title for the aggregrate.layers
- the layers to aggregate together.