com.esri.adf.web.data.geometry
Class GeometryUtil

java.lang.Object
  extended by com.esri.adf.web.data.geometry.GeometryUtil

public final class GeometryUtil
extends Object

GeometryUtil is a utility class that helps to determine spatial relations between two WebGeometries. A WebGeometry submitted to any of GeometryUtil methods must be an instance of WebPoint, WebMultiPoint, WebPolyline, WebPolygon, or WebExtent classes. GeometryUtil methods are not defined for other WebGeometry classes and UnsupportedOperationException is thrown if an instance of other WebGeometry class is submitted. GeometryUtil permits to check for presence of the following spatial relations: touch, inside, cross, overlap, and disjoint. The relations are defined as described in the "A Small Set of Formal Topological Relationships Suitable for End-User Interaction" paper by Eliseo Clementini et all. The JavaDoc for each particular relation method includes a table illustrating topological situations when the relation holds between the given geometries. Note that that GeometryUtil works with multipart geometries, i.e. with WebPolygons that have several WebRings and with WebPolylines that have several WebPaths. Note also that a WebPolyline is considered to be continuous only if coinciding WebPaths are sharing end points. In other words, precision parameter is not taken into account when checking for coincidence of WebPaths in a WebPolyline.


Field Summary
static double DEFAULT_EPSILON
           
 
Method Summary
static WebExtent computeWebExtent(WebGeometry geometry)
          Given a WebPoint, WebMultiPoint, WebPolyline, WebPolygon computes a minimal WebExtent that contains this WebGeometry.
static boolean cross(WebGeometry geometry1, WebGeometry geometry2)
          Determines if "cross" relation holds between given geometries.
static boolean cross(WebGeometry geom1, WebGeometry geom2, double precision)
           
static boolean disjoint(WebGeometry geometry1, WebGeometry geometry2)
          Determines if "disjoint" relation holds between given geometries.
static boolean disjoint(WebGeometry geom1, WebGeometry geom2, double precision)
           
static List<WebRing> getExteriorRings(WebPolygon polygon)
           
static List<WebRing> getInteriorRings(WebPolygon polygon, WebRing exteriorRing)
           
static boolean inside(WebGeometry geometry1, WebGeometry geometry2)
          Determines if "inside" relation holds between given geometries.
static boolean inside(WebGeometry geom1, WebGeometry geom2, double precision)
           
static WebGeometry intersect(WebGeometry geometry1, WebGeometry geometry2)
          Returns an intersections of the given WebGeometries.
static WebGeometry intersect(WebGeometry geometry1, WebGeometry geometry2, WebExtent extent)
          Returns an intersections of the given WebGeometries.
static boolean overlap(WebGeometry geometry1, WebGeometry geometry2)
          Determines if "overlap" relation holds between given geometries.
static boolean overlap(WebGeometry geom1, WebGeometry geom2, double precision)
           
static boolean touch(WebGeometry geometry1, WebGeometry geometry2)
          Determines if "touch" relation holds between given geometries.
static boolean touch(WebGeometry geom1, WebGeometry geom2, double precision)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_EPSILON

public static double DEFAULT_EPSILON
Method Detail

touch

public static boolean touch(WebGeometry geom1,
                            WebGeometry geom2,
                            double precision)

touch

public static boolean touch(WebGeometry geometry1,
                            WebGeometry geometry2)
Determines if "touch" relation holds between given geometries.


inside

public static boolean inside(WebGeometry geom1,
                             WebGeometry geom2,
                             double precision)

inside

public static boolean inside(WebGeometry geometry1,
                             WebGeometry geometry2)
Determines if "inside" relation holds between given geometries.


cross

public static boolean cross(WebGeometry geom1,
                            WebGeometry geom2,
                            double precision)

cross

public static boolean cross(WebGeometry geometry1,
                            WebGeometry geometry2)
Determines if "cross" relation holds between given geometries.


overlap

public static boolean overlap(WebGeometry geom1,
                              WebGeometry geom2,
                              double precision)

overlap

public static boolean overlap(WebGeometry geometry1,
                              WebGeometry geometry2)
Determines if "overlap" relation holds between given geometries.


disjoint

public static boolean disjoint(WebGeometry geom1,
                               WebGeometry geom2,
                               double precision)

disjoint

public static boolean disjoint(WebGeometry geometry1,
                               WebGeometry geometry2)
Determines if "disjoint" relation holds between given geometries.


computeWebExtent

public static WebExtent computeWebExtent(WebGeometry geometry)
Given a WebPoint, WebMultiPoint, WebPolyline, WebPolygon computes a minimal WebExtent that contains this WebGeometry. computeWebExtent for a WebPoint returns a empty WebExtent.

Parameters:
geometry - - a geometry whose WebExtent is calculated
Returns:
WebExtent of the submitted geometry

intersect

public static WebGeometry intersect(WebGeometry geometry1,
                                    WebGeometry geometry2)
Returns an intersections of the given WebGeometries.


intersect

public static WebGeometry intersect(WebGeometry geometry1,
                                    WebGeometry geometry2,
                                    WebExtent extent)
Returns an intersections of the given WebGeometries.

Parameters:
extent - the passed geometries must be inside this extent

getExteriorRings

public static List<WebRing> getExteriorRings(WebPolygon polygon)

getInteriorRings

public static List<WebRing> getInteriorRings(WebPolygon polygon,
                                             WebRing exteriorRing)