it.geosolutions.geoserver.rest.decoder.RESTBoundingBox Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of geoserver-manager Show documentation
Show all versions of geoserver-manager Show documentation
GeoServer Manager is a library to interact with GeoServer
The scope of this library is to have a simple API, and use as few external
libs as possible.
package it.geosolutions.geoserver.rest.decoder;
import org.jdom.Element;
/**
* Parse a Boundingbox of the following structure
*
*
* {@code
* 472800.0
* 817362.0
* 35053.40625
* 301500.0
* EPSG:21781
* }
*
*
* @author nmandery
* @version $Id: $
*/
public class RESTBoundingBox {
protected Element bboxElem;
/**
* Constructor for RESTBoundingBox.
*
* @param bboxElem a {@link org.jdom.Element} object.
*/
public RESTBoundingBox(Element bboxElem) {
this.bboxElem = bboxElem;
}
/**
* getCRS
*
* @return a {@link java.lang.String} object.
*/
public String getCRS() {
return this.bboxElem.getChildText("crs");
}
/**
* getEdge
*
* @param edge a {@link java.lang.String} object.
* @return a double.
*/
protected double getEdge(String edge) {
return Double.parseDouble(this.bboxElem.getChildText(edge));
}
/**
* getMinX
*
* @return a double.
*/
public double getMinX() {
return this.getEdge("minx");
}
/**
* getMaxX
*
* @return a double.
*/
public double getMaxX() {
return this.getEdge("maxx");
}
/**
* getMinY
*
* @return a double.
*/
public double getMinY() {
return this.getEdge("miny");
}
/**
* getMaxY
*
* @return a double.
*/
public double getMaxY() {
return this.getEdge("maxy");
}
}