public final class OGCTool
extends java.lang.Object
The tool class of the relevant OGC service.
Constructor and Description |
---|
OGCTool() |
Modifier and Type | Method and Description |
---|---|
static Rectangle2D |
convertBBOX2Rectangle2D(java.lang.String bbox)
Convert the BBOX parameter string of OGC to the
Rectangle2D object. |
static java.lang.String |
convertBounds2BBOX(Rectangle2D bounds)
Convert the
Rectangle2D object to the BBOX parameter string of OGC. |
static Rectangle2D |
getBoundsFromNode(org.w3c.dom.Node node)
Get the
Rectangle2D object according to the node with minx, miny, maxx and maxy. |
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));
bounds
- the Rectangle2D
object to convert.When
- IllegalArgumentException bounds or bounds.leftBottom or bounds.rightTop is empty, it will throw invalid parameter exception.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" />
node
- the source node to extract.public static Rectangle2D convertBBOX2Rectangle2D(java.lang.String bbox)
Rectangle2D
object.
A simple sample is as follows:
String bbox="1,2,3,4"; Rectangle2D rect=OGCTool.convertBBOX2Rectangle2D(bbox);
bbox
- the BBOX string to convert.