Beispiel #1
0
  /**
   * Returns the z-coordinate value for point.
   *
   * @param node xml element containing gml object(s)
   * @return z double value
   * @throws QueryException query exception
   */
  @Deterministic
  public Dbl z(final ANode node) throws QueryException {
    final Geometry geo = geo(node, Q_GML_POINT);
    if (geo == null && checkGeo(node) != null)
      throw GeoErrors.geoType(node.qname().local(), "Line");

    return Dbl.get(geo.getCoordinate().z);
  }
Beispiel #2
0
 /**
  * Returns the area of a Geometry. Areal Geometries have a non-zero area. Returns zero for Point
  * and Lines.
  *
  * @param node xml element containing gml object(s)
  * @return geometry area as a double vaue
  * @throws QueryException query exception
  */
 @Deterministic
 public Dbl area(final ANode node) throws QueryException {
   return Dbl.get(checkGeo(node).getArea());
 }
Beispiel #3
0
 /**
  * Returns the length of this Geometry. Linear geometries return their length. Areal geometries
  * return their parameter. Others return 0.0
  *
  * @param node xml element containing gml object(s)
  * @return length double value
  * @throws QueryException query exception
  */
 @Deterministic
 public Dbl length(final ANode node) throws QueryException {
   return Dbl.get(checkGeo(node).getLength());
 }
Beispiel #4
0
 /**
  * Returns a polygon that represents all Points whose distance from this geometric object is less
  * than or equal to distance. The returned element must be either gml:Polygon, gml:LineString or
  * gml:Point.
  *
  * @param node xml element containing gml object(s)
  * @param distance specific distance from the $geometry (the buffer width)
  * @return buffer geometry as gml element
  * @throws QueryException query exception
  */
 @Deterministic
 public ANode buffer(final ANode node, final Dbl distance) throws QueryException {
   return gmlWriter(checkGeo(node).buffer(distance.dbl()));
 }
Beispiel #5
0
 /**
  * Returns the shortest distance in the units of the spatial reference system of geometry, between
  * the geometries. The distance is the distance between a point on each of the geometries.
  *
  * @param node1 xml element containing gml object(s)
  * @param node2 xml element containing gml object(s)
  * @return distance double value
  * @throws QueryException query exception
  */
 @Deterministic
 public Dbl distance(final ANode node1, final ANode node2) throws QueryException {
   final Geometry geo1 = checkGeo(node1);
   final Geometry geo2 = checkGeo(node2);
   return Dbl.get(geo1.distance(geo2));
 }