com.supermap.services
Class OGCTool
- java.lang.Object
-
- com.supermap.services.OGCTool
-
public final class OGCTool extends java.lang.ObjectThe tool class of the relevant OGC service.
-
-
Constructor Summary
Constructors Constructor and Description OGCTool()
-
Method Summary
Methods Modifier and Type Method and Description static Rectangle2DconvertBBOX2Rectangle2D(java.lang.String bbox)Convert the BBOX parameter string of OGC to theRectangle2Dobject.static java.lang.StringconvertBounds2BBOX(Rectangle2D bounds)Convert theRectangle2Dobject to the BBOX parameter string of OGC.static Rectangle2DgetBoundsFromNode(org.w3c.dom.Node node)Get theRectangle2Dobject according to the node with minx, miny, maxx and maxy.
-
-
-
Method Detail
-
convertBounds2BBOX
public static java.lang.String convertBounds2BBOX(Rectangle2D bounds)
Convert the
Rectangle2Dobject 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- theRectangle2Dobject 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
Rectangle2Dobject 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 theRectangle2Dobject.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.
-
-