/** * Returns the DE-9IM {@link IntersectionMatrix} for the two <code>Geometry</code>s. * *@param g the <code>Geometry</code> with which to compare this <code>Geometry</code> *@return an {@link IntersectionMatrix} describing the intersections of the interiors, * boundaries and exteriors of the two <code>Geometry</code>s */ public IntersectionMatrix relate(Geometry g) { checkNotGeometryCollection(this); checkNotGeometryCollection(g); return RelateOp.relate(this, g); }
/** * Computes a <code>Geometry</code> representing the closure of the point-set * of the points contained in this <code>Geometry</code> that are not contained in * the <code>other</code> Geometry. * <p> * If the result is empty, it is an atomic geometry * with the dimension of the left-hand input. * <p> * Non-empty {@link GeometryCollection} arguments are not supported. * *@param other the <code>Geometry</code> with which to compute the * difference *@return a Geometry representing the point-set difference of this <code>Geometry</code> with * <code>other</code> * @throws TopologyException if a robustness error occurs * @throws IllegalArgumentException if either input is a non-empty GeometryCollection */ public Geometry difference(Geometry other) { // special case: if A.isEmpty ==> empty; if B.isEmpty ==> A if (this.isEmpty()) return OverlayOp.createEmptyResult(OverlayOp.DIFFERENCE, this, other, factory); if (other.isEmpty()) return (Geometry) clone(); checkNotGeometryCollection(this); checkNotGeometryCollection(other); return SnapIfNeededOverlayOp.overlayOp(this, other, OverlayOp.DIFFERENCE); }
checkNotGeometryCollection(this); checkNotGeometryCollection(other); return SnapIfNeededOverlayOp.overlayOp(this, other, OverlayOp.INTERSECTION);
checkNotGeometryCollection(this); checkNotGeometryCollection(other); return SnapIfNeededOverlayOp.overlayOp(this, other, OverlayOp.SYMDIFFERENCE);
checkNotGeometryCollection(this); checkNotGeometryCollection(other); return SnapIfNeededOverlayOp.overlayOp(this, other, OverlayOp.UNION);
/** * Returns the DE-9IM {@link IntersectionMatrix} for the two <code>Geometry</code>s. * *@param g the <code>Geometry</code> with which to compare this <code>Geometry</code> *@return an {@link IntersectionMatrix} describing the intersections of the interiors, * boundaries and exteriors of the two <code>Geometry</code>s */ public IntersectionMatrix relate(Geometry g) { checkNotGeometryCollection(this); checkNotGeometryCollection(g); return RelateOp.relate(this, g); }
/** * Computes a <code>Geometry</code> representing the closure of the point-set * of the points contained in this <code>Geometry</code> that are not contained in * the <code>other</code> Geometry. * <p> * If the result is empty, it is an atomic geometry * with the dimension of the left-hand input. * <p> * Non-empty {@link GeometryCollection} arguments are not supported. * *@param other the <code>Geometry</code> with which to compute the * difference *@return a Geometry representing the point-set difference of this <code>Geometry</code> with * <code>other</code> * @throws TopologyException if a robustness error occurs * @throws IllegalArgumentException if either input is a non-empty GeometryCollection */ public Geometry difference(Geometry other) { // special case: if A.isEmpty ==> empty; if B.isEmpty ==> A if (this.isEmpty()) return OverlayOp.createEmptyResult(OverlayOp.DIFFERENCE, this, other, factory); if (other.isEmpty()) return (Geometry) clone(); checkNotGeometryCollection(this); checkNotGeometryCollection(other); return SnapIfNeededOverlayOp.overlayOp(this, other, OverlayOp.DIFFERENCE); }
checkNotGeometryCollection(this); checkNotGeometryCollection(other); return SnapIfNeededOverlayOp.overlayOp(this, other, OverlayOp.INTERSECTION);
checkNotGeometryCollection(this); checkNotGeometryCollection(other); return SnapIfNeededOverlayOp.overlayOp(this, other, OverlayOp.SYMDIFFERENCE);
checkNotGeometryCollection(this); checkNotGeometryCollection(other); return SnapIfNeededOverlayOp.overlayOp(this, other, OverlayOp.UNION);