Class WMSXMLEncoder111
- java.lang.Object
-
- com.supermap.services.wms.AbstractWMSXMLEncoder
-
- com.supermap.services.wms.WMSXMLEncoder111
-
- All Implemented Interfaces:
- WMSXMLEncoder
- Direct Known Subclasses:
- WMSXMLEncoder130
public class WMSXMLEncoder111 extends AbstractWMSXMLEncoder
WMS 1.1.1 XML document encoder.
Convert the relevant WMS objects of SuperMap iServer to the XML document of WMS 1.1.1 service based on OGC standard.
-
-
Field Summary
-
Fields inherited from class com.supermap.services.wms.AbstractWMSXMLEncoder
capabilitiesDTDOrXSD, CRS, exceptionDTDOrXSD, featureDTDOrXSD, OGC_NAMESPACE_URL, providerUrl, SRS, WMS_NAMESPACE_URL
-
-
Constructor Summary
Constructors Constructor and Description WMSXMLEncoder111()The Constructor.WMSXMLEncoder111(java.util.Map<java.lang.String,java.lang.String> urls)Constructs the WMSXMLEncoder111 object according to a series of document directories.
-
Method Summary
Methods Modifier and Type Method and Description java.lang.Stringencode(OGCException[] exceptions)Convert theOGCExceptionobject to XML document string format of exception information.java.lang.Stringencode(WMSCapabilities wmsCapabilities)Construct theWMSCapabilitiesobject to Capabilities XML document string format of WMS service.java.lang.Stringencode(WMSFeatureInfo[] featureInfos, java.lang.String format)Construct theWMSFeatureInfoobject to XML document string format of WMS 1.1.1 GetFeatureInfo operation.protected java.lang.StringensureNoXSS(java.lang.String message)Get the matching informationprotected java.lang.String[]getBBoxAttributeValue(Rectangle2D rect)Gets the value of the bounding box (geographic range).java.lang.StringgetVersion()Gets the WMS service version.protected voidonlineResourceElement(Node fatherNode)Set OnlineResource node.protected NodewriteCapabilitiesNode(Node rootNode, WMSCapabilities wmsCapabilities)Create the Capability node of WMS 1.1.1 Capabilities XML file in the root node of the WMS 1.1.1 Capabilities XML file.protected voidwriteCRSNode(Node layerNode, WMSCapabilities wmsCapabilities)Add CRS node to the node which is represented with layerNode.protected voidwriteCRSNode(Node layerNode, WMSLayer wmsLayer)Add SRS node in the Layer node.protected NodewriteLatLonBounds(Node layerNode, Rectangle2D layerBounds)Add the LatLonBoundingBox node in Layer node, set the property of the node.protected voidwriteLatLonBoundsAttribute(Node node, Rectangle2D layerBounds)Set the property value of the LatLonBoundingBox node.protected NodewriteLayer(Node fatherNode, WMSLayer wmsLayer, Rectangle2D mapBounds, WMSCapabilities wmsCapabilities)Add Layer child nodes and other related nodes in the Layer parent node.protected voidwriteLayerStyle(Node styleNode, UserStyleElement layerStyle)Set the style of the layer, please refer to geoServer and the official SLD documentprotected voidwriterLayers(Node mapNode, WMSCapabilities wmsCapabilities)Add Layer node and relevant nodes in the node which is represented with mapNode.protected NodewriteRootNode(Node doc)Create the root node of WMS 1.1.1 Capabilities XML document, which is WMT_MS_Capabilities node.protected voidwriteServiceNameNode(Node serviceNode)Add Name node in Service node.protected NodewriteServiceNode(Node rootNode, ServiceDescription serviceDescription)Create the Service node of WMS 1.1.1 Capabilities XML file in the root node of the WMS 1.1.1 Capabilities XML file.protected voidwriteSRSBounds(Node layerNode, WMSLayer wmsLayer)Write to SRSBounds-
Methods inherited from class com.supermap.services.wms.AbstractWMSXMLEncoder
getCapabilitiesDTDOrXSD, getExceptionDTDOrXSD, getFeatureDTDOrXSD, setCapabilitiesDTDOrXSD, setExceptionDTDOrXSD, setFeatureDTDOrXSD, setProviderUrl
-
-
-
-
Constructor Detail
-
WMSXMLEncoder111
public WMSXMLEncoder111()
The Constructor.
-
WMSXMLEncoder111
public WMSXMLEncoder111(java.util.Map<java.lang.String,java.lang.String> urls)
Constructs the WMSXMLEncoder111 object according to a series of document directories.
- Parameters:
urls- This parameter is a Map mapping. The key values for the mapping are CapabilitiesDTDOrXSD, providerUrl, exceptionDTDOrXSD, and featureDTDOrXSD, and the key value is the corresponding document (URL) address.
-
-
Method Detail
-
writeRootNode
protected Node writeRootNode(Node doc)
Create the root node of WMS 1.1.1 Capabilities XML document, which is WMT_MS_Capabilities node.
- Specified by:
writeRootNodein classAbstractWMSXMLEncoder- Parameters:
doc- XML document root node, such as “<?xml version="1.0" encoding="UTF-8"?>”- Returns:
- the root node of WMS 1.1.1 Capabilities XML document, which is WMT_MS_Capabilities node.
-
writeServiceNameNode
protected void writeServiceNameNode(Node serviceNode)
Add Name node in Service node.
The Name node is used to describe the name of the service. The value of the Name node defaults to "OGC: WMS".
- Specified by:
writeServiceNameNodein classAbstractWMSXMLEncoder- Parameters:
serviceNode- Service node.
-
writeServiceNode
protected Node writeServiceNode(Node rootNode, ServiceDescription serviceDescription)
Create the Service node of WMS 1.1.1 Capabilities XML file in the root node of the WMS 1.1.1 Capabilities XML file.
- Parameters:
rootNode- the root node of WMS 1.1.1 Capabilities XML document, which is WMT_MS_Capabilities node.serviceDescription- service meta data information.- Returns:
- Service node.
-
writeCapabilitiesNode
protected Node writeCapabilitiesNode(Node rootNode, WMSCapabilities wmsCapabilities)
Create the Capability node of WMS 1.1.1 Capabilities XML file in the root node of the WMS 1.1.1 Capabilities XML file.
- Parameters:
rootNode- the root node of WMS 1.1.1 Capabilities XML document, which is WMT_MS_Capabilities node.wmsCapabilities- WMS meta information.- Returns:
- Capability node.
-
encode
public java.lang.String encode(WMSCapabilities wmsCapabilities)
Construct theWMSCapabilitiesobject to Capabilities XML document string format of WMS service.- Parameters:
wmsCapabilities- WMSCapabilities object.- Returns:
- Capabilities XML document string format.
-
writeLayer
protected Node writeLayer(Node fatherNode, WMSLayer wmsLayer, Rectangle2D mapBounds, WMSCapabilities wmsCapabilities)
Add Layer child nodes and other related nodes in the Layer parent node.
In SuperMap iServer, a Layer root node (Level 1 Layer node) corresponds to a map, the Layer node under the Layer root node indicates the map set (Level 2 Layer node), the Layer node under the level 2 Layer node indicates the layer.
- Specified by:
writeLayerin classAbstractWMSXMLEncoder- Parameters:
fatherNode- the Layer parent node.wmsLayer- WMS layer.mapBounds- the geographical range of the map.- Returns:
- Level 1 node under the Layer parent node.
-
writeLayerStyle
protected void writeLayerStyle(Node styleNode, UserStyleElement layerStyle)
Set the style of the layer, please refer to geoServer and the official SLD document- Specified by:
writeLayerStylein classAbstractWMSXMLEncoder- Parameters:
styleNode- Layer node.
-
writeCRSNode
protected void writeCRSNode(Node layerNode, WMSLayer wmsLayer)
Add SRS node in the Layer node.
The default value of the SRS node is “EPSG:4326”.
- Specified by:
writeCRSNodein classAbstractWMSXMLEncoder- Parameters:
layerNode- Layer node.wmsCapabilities-
-
writeLatLonBounds
protected Node writeLatLonBounds(Node layerNode, Rectangle2D layerBounds)
Add the LatLonBoundingBox node in Layer node, set the property of the node.
- Parameters:
layerNode- Layer node.layerBounds-layerBounds- geographical bounds.- Returns:
- LatLonBoundingBox node.
-
writeLatLonBoundsAttribute
protected void writeLatLonBoundsAttribute(Node node, Rectangle2D layerBounds)
Set the property value of the LatLonBoundingBox node.
The properties of the LatLonBoundingBox node contain minx, miny, maxx and maxy.
- Parameters:
node- LatLonBoundingBox node.layerBounds,- Rectangle2D mapBounds geographical bounds.
-
writerLayers
protected void writerLayers(Node mapNode, WMSCapabilities wmsCapabilities)
Add Layer node and relevant nodes in the node which is represented with mapNode.
The node which is represented with mapNode is the level 1 Layer node of the Capabilities XML document.
- Parameters:
mapNode- the level 1 Layer node of the Capabilities XML document.wmsCapabilities- WMS meta information.
-
writeCRSNode
protected void writeCRSNode(Node layerNode, WMSCapabilities wmsCapabilities)
Add CRS node to the node which is represented with layerNode.- Parameters:
layerNode-wmsCapabilities-
-
onlineResourceElement
protected void onlineResourceElement(Node fatherNode)
Set OnlineResource node.
Include setting the parent node of the OnlineResource node: DCPType, HTTP and Get nodes.
- Parameters:
fatherNode- the parent node of the OnlineResource node.
-
getBBoxAttributeValue
protected java.lang.String[] getBBoxAttributeValue(Rectangle2D rect)
Gets the value of the bounding box (geographic range). Including minx, miny, maxx and maxy.
- Parameters:
rect- the geographical range.- Returns:
- string array, which stores the minx, miny, maxx and maxy values.
-
encode
public java.lang.String encode(WMSFeatureInfo[] featureInfos, java.lang.String format)
Construct the
WMSFeatureInfoobject to XML document string format of WMS 1.1.1 GetFeatureInfo operation.- Parameters:
featureInfos- WMSFeatureInfo object array.- Returns:
- XML document string format of GetFeatureInfo operation.
-
encode
public java.lang.String encode(OGCException[] exceptions) throws org.w3c.dom.DOMException
Convert the
OGCExceptionobject to XML document string format of exception information.- Parameters:
exceptions- OGC exception object array.- Returns:
- XML document string format of exception information.
- Throws:
org.w3c.dom.DOMException
-
ensureNoXSS
protected java.lang.String ensureNoXSS(java.lang.String message)
Get the matching information- Parameters:
message- the information to match- Returns:
-
getVersion
public java.lang.String getVersion()
Gets the WMS service version.
- Returns:
- return “1.1.1”.
-
-