com.supermap.services

Class OGCTool

  • java.lang.Object
    • com.supermap.services.OGCTool


  • public final class OGCTool
    extends java.lang.Object
    

    The tool class of the relevant OGC service.

    • Constructor Summary

      Constructors 
      Constructor and Description
      OGCTool() 
    • Constructor Detail

      • OGCTool

        public OGCTool()
        
    • Method Detail

      • convertBounds2BBOX

        public static java.lang.String convertBounds2BBOX(Rectangle2D bounds)
        

        Convert the Rectangle2D object to the BBOX parameter string of OGC.

        A simple sample is as follows:

         Rectangle2D rect=new Rectangle2D(1, 2, 3, 4);
         System.out.println(OGCTool.convertBounds2BBOX(rect));
         
        
        Parameters:
        bounds - the Rectangle2D object to convert.
        Returns:
        BBOX parameter string.
        Throws:
        When - IllegalArgumentException bounds or bounds.leftBottom or bounds.rightTop is empty, it will throw invalid parameter exception.
      • getBoundsFromNode

        public static Rectangle2D getBoundsFromNode(org.w3c.dom.Node node)
        

        Get the Rectangle2D object according to the node with minx, miny, maxx and maxy.

        For example, in the following node extraction, you can get the Rectangle2D object with the lower left coordinates (1.0, 2.0) and the upper right coordinates (3.0, 4.5).

         <LatLongBounds minx="1.0" miny="2.0" maxx="3.0" maxy="4.5" />
         
        

        Parameters:
        node - the source node to extract.
        Returns:
        Rectangle2D object If there are no anyone of the four attributes minx, miny, maxx, maxy in the node, or the attribute value can not be converted to double, then return null.
      • convertBBOX2Rectangle2D

        public static Rectangle2D convertBBOX2Rectangle2D(java.lang.String bbox)
        
        Convert the BBOX parameter string of OGC to the Rectangle2D object.

        A simple sample is as follows:

         String bbox="1,2,3,4";
         Rectangle2D rect=OGCTool.convertBBOX2Rectangle2D(bbox);
         
        
        Parameters:
        bbox - the BBOX string to convert.
        Returns:
        Rectangle2D object When the bbox parameter is invalid, it returns null.