com.supermap.services.wms

Class 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.

    • 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:
        writeRootNode in class AbstractWMSXMLEncoder
        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:
        writeServiceNameNode in class AbstractWMSXMLEncoder
        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 the WMSCapabilities object 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:
        writeLayer in class AbstractWMSXMLEncoder
        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.
      • writeSRSBounds

        protected void writeSRSBounds(Node layerNode,
                          WMSLayer wmsLayer)
        
        Write to SRSBounds
      • 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:
        writeLayerStyle in class AbstractWMSXMLEncoder
        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:
        writeCRSNode in class AbstractWMSXMLEncoder
        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 WMSFeatureInfo object 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 OGCException object 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”.