Package com.vividsolutions.wms
Class WMService
- java.lang.Object
-
- com.vividsolutions.wms.WMService
-
public class WMService extends Object
Represents a remote WMS Service.- Author:
- Chris Hodgson chodgson@refractions.net
-
-
Constructor Summary
Constructors Constructor Description WMService(String serverUrl)Constructs a WMService object from a server URL.WMService(String serverUrl, String wmsVersion)Constructs a WMService object from a server URL.WMService(String serverUrl, String wmsVersion, String apiKeyNameAndValue, boolean apiKeyNeededFotGetCapabilities)Constructs a WMService object from a server URL.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MapRequestcreateMapRequest()Creates a new MapRequest object which can be used to retrieve a Map from this service.CapabilitiesgetCapabilities()Gets the Capabilities for this service.StringgetServerUrl()Gets the url string of the map service.URLgetServerUrlAsUrl()Gets the url object of the map service.StringgetTitle()Gets the title of the map service.StringgetVersion()StringgetWmsVersion()voidinitialize()voidinitialize(boolean alertDifferingURL)Connect to the service and get the capabilities.
-
-
-
Field Detail
-
WMS_1_0_0
public static final String WMS_1_0_0
- See Also:
- Constant Field Values
-
WMS_1_1_0
public static final String WMS_1_1_0
- See Also:
- Constant Field Values
-
WMS_1_1_1
public static final String WMS_1_1_1
- See Also:
- Constant Field Values
-
WMS_1_3_0
public static final String WMS_1_3_0
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WMService
public WMService(String serverUrl, String wmsVersion, String apiKeyNameAndValue, boolean apiKeyNeededFotGetCapabilities)
Constructs a WMService object from a server URL.- Parameters:
serverUrl- the URL of the WMS serverwmsVersion- the WMS versionapiKeyNameAndValue- a formatted string containing API Key and Value or nullapiKeyNeededFotGetCapabilities- a boolean with value true if apiKeyNameAndValue is also needed for GetCapabilities
-
WMService
public WMService(String serverUrl, String wmsVersion)
Constructs a WMService object from a server URL.- Parameters:
serverUrl- the URL of the WMS serverwmsVersion- the WMS version
-
WMService
public WMService(String serverUrl)
Constructs a WMService object from a server URL.- Parameters:
serverUrl- the URL of the WMS server
-
-
Method Detail
-
initialize
public void initialize() throws IOException- Throws:
IOException- if an error occurs during connection initialization
-
getWmsVersion
public String getWmsVersion()
-
initialize
public void initialize(boolean alertDifferingURL) throws IOExceptionConnect to the service and get the capabilities. This must be called before anything else is done with this service.- Parameters:
alertDifferingURL- alert the user if a different GetMap URL is available- Throws:
IOException- if an error occurs during connection initialization
-
getServerUrl
public String getServerUrl()
Gets the url string of the map service.- Returns:
- the url of the WMService
-
getServerUrlAsUrl
public URL getServerUrlAsUrl()
Gets the url object of the map service. Added as the getServerUrl() was there earlier for backward compatibility.- Returns:
- the url of the WMService
-
getTitle
public String getTitle()
Gets the title of the map service. The service must have previously been initialized, otherwise null is returned.- Returns:
- the title of the WMService
-
getCapabilities
public Capabilities getCapabilities()
Gets the Capabilities for this service. The service must have previously been initialized, otherwise null is returned.- Returns:
- a copy of the MapDescriptor for this service
-
createMapRequest
public MapRequest createMapRequest()
Creates a new MapRequest object which can be used to retrieve a Map from this service.- Returns:
- a MapRequest object which can be used to retrieve a map image from this service
-
getVersion
public String getVersion()
-
-