class WMS extends java.lang.Object
The Web Map Server (WMS) module is a connection to a remote WMS server.
You can use it to get information on the WMS Server just as name, version, formats, layers:def wms = new WMS("http://localhost:8080/geoserver/ows?service=wms&version=1.1.1&request=GetCapabilities")
Or you can use it to render images or extract Rasters:println "Name: ${wms.name}" println "Version: ${wms.version}" println "Formats: ${wms.getMapFormats.join(',')}" wms.layers.each{layer -> println "${layer.name}" }
def image = wms.getImage("world:borders") ImageIO.write(image,"png",new File("world.png")) def raster = wms.getRaster(["world:cities","world:borders"]) ImageIO.write(raster.image,"png",new File("raster_world_cities.png"))
Modifiers | Name | Description |
---|---|---|
protected static class |
WMS.Layer |
A WMS.Layer |
Type | Name and description |
---|---|
WebMapServer |
wms The GeoTools WebMapServer |
Type Params | Return Type | Name and description |
---|---|---|
|
java.lang.String |
getAbstract() Get the abstract (WMT_MS_Capabilities/Service/Abstract) |
|
java.util.List |
getGetMapFormats() Get the GetMap formats |
|
java.awt.image.BufferedImage |
getImage(Map options, java.lang.Object layers) Get a Image from the WMS server. |
|
java.util.List |
getKeywords() Get a List of keywords |
|
Layer |
getLayer(java.lang.String name) Get a WMS.Layer by name |
|
java.util.List |
getLayers() Get a List of WMS.Layers |
|
java.awt.image.BufferedImage |
getLegend(Map options, java.lang.Object layer) Get a legend from a WMS service. |
|
java.lang.String |
getName() Get the name (WMT_MS_Capabilities/Service/Name) |
|
java.net.URL |
getOnlineResource() Get the online resource URL |
|
Raster |
getRaster(Map options, java.lang.Object layers) Get a Raster from the WMS server |
|
java.lang.String |
getTitle() Get the title (WMT_MS_Capabilities/Service/Title) |
|
java.lang.String |
getUpdateSequence() Get the update sequence |
|
java.lang.String |
getVersion() Get the version |
|
java.lang.String |
toString() The String representation @return |
Methods inherited from class | Name |
---|---|
class java.lang.Object |
java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll() |
The GeoTools WebMapServer
Create a new WMS object with a get capabilities URL
options
- Optional named parameters:
url
- The get capabilities URLCreate a new WMS object with a get capabilities URL
options
- Optional named parameters:
url
- The get capabilities URLGet the abstract (WMT_MS_Capabilities/Service/Abstract)
Get the GetMap formats
Get a Image from the WMS server.
options
- Named parameter options may include:
layers
- The Layers to include on the image. Layers can be a single WMS.Layer, layer name, or
map with name and style keys or it can be a List of the previously mentioned values.Get a List of keywords
Get a WMS.Layer by name
The
- nameGet a List of WMS.Layers
Get a legend from a WMS service.
options
- Named parameter options
Get the name (WMT_MS_Capabilities/Service/Name)
Get the online resource URL
Get a Raster from the WMS server
options
- Named parameter options may include:
layers
- The Layers to include on the image. Layers can be a single WMS.Layer, layer name, or
map with name and style keys or it can be a List of the previously mentioned values.Get the title (WMT_MS_Capabilities/Service/Title)
Get the update sequence
Get the version
The String representation @return
Groovy Documentation