本文整理汇总了Java中com.vividsolutions.jts.operation.overlay.OverlayOp.createEmptyResult方法的典型用法代码示例。如果您正苦于以下问题:Java OverlayOp.createEmptyResult方法的具体用法?Java OverlayOp.createEmptyResult怎么用?Java OverlayOp.createEmptyResult使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vividsolutions.jts.operation.overlay.OverlayOp
的用法示例。
在下文中一共展示了OverlayOp.createEmptyResult方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: intersection
import com.vividsolutions.jts.operation.overlay.OverlayOp; //导入方法依赖的package包/类
/**
* Computes a <code>Geometry</code> representing the point-set which is
* common to both this <code>Geometry</code> and the <code>other</code> Geometry.
* <p>
* The intersection of two geometries of different dimension produces a result
* geometry of dimension less than or equal to the minimum dimension of the input
* geometries.
* The result geometry may be a heterogenous {@link GeometryCollection}.
* If the result is empty, it is an atomic geometry
* with the dimension of the lowest input dimension.
* <p>
* Intersection of {@link GeometryCollection}s is supported
* only for homogeneous collection types.
* <p>
* Non-empty heterogeneous {@link GeometryCollection} arguments are not supported.
*
* @param other the <code>Geometry</code> with which to compute the intersection
* @return a Geometry representing the point-set common to the two <code>Geometry</code>s
* @throws TopologyException if a robustness error occurs
* @throws IllegalArgumentException if the argument is a non-empty heterogeneous <code>GeometryCollection</code>
*/
public Geometry intersection(Geometry other) {
/**
* TODO: MD - add optimization for P-A case using Point-In-Polygon
*/
// special case: if one input is empty ==> empty
if (this.isEmpty() || other.isEmpty()) {
return OverlayOp.createEmptyResult(OverlayOp.INTERSECTION, this, other, this.factory);
}
// compute for GCs
if (this.isGeometryCollection()) {
final Geometry g2 = other;
return GeometryCollectionMapper.map(
(GeometryCollection) this,
g -> g.intersection(g2));
}
// if (isGeometryCollection(other))
// return other.intersection(this);
this.checkNotGeometryCollection(this);
this.checkNotGeometryCollection(other);
return SnapIfNeededOverlayOp.overlayOp(this, other, OverlayOp.INTERSECTION);
}
示例2: symDifference
import com.vividsolutions.jts.operation.overlay.OverlayOp; //导入方法依赖的package包/类
/**
* Computes a <coe>Geometry </code> representing the closure of the point-set
* which is the union of the points in this <code>Geometry</code> which are not
* contained in the <code>other</code> Geometry,
* with the points in the <code>other</code> Geometry not contained in this
* <code>Geometry</code>.
* If the result is empty, it is an atomic geometry
* with the dimension of the highest input dimension.
* <p>
* Non-empty {@link GeometryCollection} arguments are not supported.
*
* @param other the <code>Geometry</code> with which to compute the symmetric
* difference
* @return a Geometry representing the point-set symmetric 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 symDifference(Geometry other) {
// handle empty geometry cases
if (this.isEmpty() || other.isEmpty()) {
// both empty - check dimensions
if (this.isEmpty() && other.isEmpty()) {
return OverlayOp.createEmptyResult(OverlayOp.SYMDIFFERENCE, this, other, this.factory);
}
// special case: if either input is empty ==> result = other arg
if (this.isEmpty()) {
return (Geometry) other.clone();
}
if (other.isEmpty()) {
return (Geometry) this.clone();
}
}
this.checkNotGeometryCollection(this);
this.checkNotGeometryCollection(other);
return SnapIfNeededOverlayOp.overlayOp(this, other, OverlayOp.SYMDIFFERENCE);
}
示例3: intersection
import com.vividsolutions.jts.operation.overlay.OverlayOp; //导入方法依赖的package包/类
/**
* Computes a <code>Geometry</code> representing the point-set which is
* common to both this <code>Geometry</code> and the <code>other</code> Geometry.
* <p/>
* The intersection of two geometries of different dimension produces a result
* geometry of dimension less than or equal to the minimum dimension of the input
* geometries.
* The result geometry may be a heterogenous {@link GeometryCollection}.
* If the result is empty, it is an atomic geometry
* with the dimension of the lowest input dimension.
* <p/>
* Intersection of {@link GeometryCollection}s is supported
* only for homogeneous collection types.
* <p/>
* Non-empty heterogeneous {@link GeometryCollection} arguments are not supported.
*
* @param other the <code>Geometry</code> with which to compute the intersection
* @return a Geometry representing the point-set common to the two <code>Geometry</code>s
* @throws TopologyException if a robustness error occurs
* @throws IllegalArgumentException if the argument is a non-empty heterogeneous <code>GeometryCollection</code>
*/
public Geometry intersection(Geometry other) {
/**
* TODO: MD - add optimization for P-A case using Point-In-Polygon
*/
// special case: if one input is empty ==> empty
if (this.isEmpty() || other.isEmpty())
return OverlayOp.createEmptyResult(OverlayOp.INTERSECTION, this, other, factory);
// compute for GCs
if (this.isGeometryCollection()) {
final Geometry g2 = other;
return GeometryCollectionMapper.map(
(GeometryCollection) this,
new GeometryMapper.MapOp() {
public Geometry map(Geometry g) {
return g.intersection(g2);
}
});
}
// if (isGeometryCollection(other))
// return other.intersection(this);
checkNotGeometryCollection(this);
checkNotGeometryCollection(other);
return SnapIfNeededOverlayOp.overlayOp(this, other, OverlayOp.INTERSECTION);
}
示例4: intersection
import com.vividsolutions.jts.operation.overlay.OverlayOp; //导入方法依赖的package包/类
/**
* Computes a <code>Geometry</code> representing the point-set which is
* common to both this <code>Geometry</code> and the <code>other</code> Geometry.
* <p>
* The intersection of two geometries of different dimension produces a result
* geometry of dimension less than or equal to the minimum dimension of the input
* geometries.
* The result geometry may be a heterogenous {@link GeometryCollection}.
* If the result is empty, it is an atomic geometry
* with the dimension of the lowest input dimension.
* <p>
* Intersection of {@link GeometryCollection}s is supported
* only for homogeneous collection types.
* <p>
* Non-empty heterogeneous {@link GeometryCollection} arguments are not supported.
*
* @param other the <code>Geometry</code> with which to compute the intersection
* @return a Geometry representing the point-set common to the two <code>Geometry</code>s
* @throws TopologyException if a robustness error occurs
* @throws IllegalArgumentException if the argument is a non-empty heterogeneous <code>GeometryCollection</code>
*/
public Geometry intersection(Geometry other)
{
/**
* TODO: MD - add optimization for P-A case using Point-In-Polygon
*/
// special case: if one input is empty ==> empty
if (this.isEmpty() || other.isEmpty())
return OverlayOp.createEmptyResult(OverlayOp.INTERSECTION, this, other, factory);
// compute for GCs
if (this.isGeometryCollection()) {
final Geometry g2 = other;
return GeometryCollectionMapper.map(
(GeometryCollection) this,
new GeometryMapper.MapOp() {
public Geometry map(Geometry g) {
return g.intersection(g2);
}
});
}
// if (isGeometryCollection(other))
// return other.intersection(this);
checkNotGeometryCollection(this);
checkNotGeometryCollection(other);
return SnapIfNeededOverlayOp.overlayOp(this, other, OverlayOp.INTERSECTION);
}
示例5: union
import com.vividsolutions.jts.operation.overlay.OverlayOp; //导入方法依赖的package包/类
/**
* Computes a <code>Geometry</code> representing the point-set
* which is contained in both this
* <code>Geometry</code> and the <code>other</code> Geometry.
* <p>
* The union of two geometries of different dimension produces a result
* geometry of dimension equal to the maximum dimension of the input
* geometries.
* The result geometry may be a heterogenous
* {@link GeometryCollection}.
* If the result is empty, it is an atomic geometry
* with the dimension of the highest input dimension.
* <p>
* Unioning {@link LineString}s has the effect of
* <b>noding</b> and <b>dissolving</b> the input linework. In this context
* "noding" means that there will be a node or endpoint in the result for
* every endpoint or line segment crossing in the input. "Dissolving" means
* that any duplicate (i.e. coincident) line segments or portions of line
* segments will be reduced to a single line segment in the result.
* If <b>merged</b> linework is required, the {@link LineMerger}
* class can be used.
* <p>
* Non-empty {@link GeometryCollection} arguments are not supported.
*
* @param other the <code>Geometry</code> with which to compute the union
* @return a point-set combining the points of this <code>Geometry</code> and the
* points of <code>other</code>
* @throws TopologyException if a robustness error occurs
* @throws IllegalArgumentException if either input is a non-empty GeometryCollection
* @see LineMerger
*/
public Geometry union(Geometry other) {
// handle empty geometry cases
if (this.isEmpty() || other.isEmpty()) {
if (this.isEmpty() && other.isEmpty()) {
return OverlayOp.createEmptyResult(OverlayOp.UNION, this, other, this.factory);
}
// special case: if either input is empty ==> other input
if (this.isEmpty()) {
return (Geometry) other.clone();
}
if (other.isEmpty()) {
return (Geometry) this.clone();
}
}
// TODO: optimize if envelopes of geometries do not intersect
this.checkNotGeometryCollection(this);
this.checkNotGeometryCollection(other);
return SnapIfNeededOverlayOp.overlayOp(this, other, OverlayOp.UNION);
}
示例6: union
import com.vividsolutions.jts.operation.overlay.OverlayOp; //导入方法依赖的package包/类
/**
* Computes a <code>Geometry</code> representing the point-set
* which is contained in both this
* <code>Geometry</code> and the <code>other</code> Geometry.
* <p/>
* The union of two geometries of different dimension produces a result
* geometry of dimension equal to the maximum dimension of the input
* geometries.
* The result geometry may be a heterogenous
* {@link GeometryCollection}.
* If the result is empty, it is an atomic geometry
* with the dimension of the highest input dimension.
* <p/>
* Unioning {@link LineString}s has the effect of
* <b>noding</b> and <b>dissolving</b> the input linework. In this context
* "noding" means that there will be a node or endpoint in the result for
* every endpoint or line segment crossing in the input. "Dissolving" means
* that any duplicate (i.e. coincident) line segments or portions of line
* segments will be reduced to a single line segment in the result.
* If <b>merged</b> linework is required, the {@link LineMerger}
* class can be used.
* <p/>
* Non-empty {@link GeometryCollection} arguments are not supported.
*
* @param other the <code>Geometry</code> with which to compute the union
* @return a point-set combining the points of this <code>Geometry</code> and the
* points of <code>other</code>
* @throws TopologyException if a robustness error occurs
* @throws IllegalArgumentException if either input is a non-empty GeometryCollection
* @see LineMerger
*/
public Geometry union(Geometry other) {
// handle empty geometry cases
if (this.isEmpty() || other.isEmpty()) {
if (this.isEmpty() && other.isEmpty())
return OverlayOp.createEmptyResult(OverlayOp.UNION, this, other, factory);
// special case: if either input is empty ==> other input
if (this.isEmpty()) return (Geometry) other.clone();
if (other.isEmpty()) return (Geometry) clone();
}
// TODO: optimize if envelopes of geometries do not intersect
checkNotGeometryCollection(this);
checkNotGeometryCollection(other);
return SnapIfNeededOverlayOp.overlayOp(this, other, OverlayOp.UNION);
}
示例7: symDifference
import com.vividsolutions.jts.operation.overlay.OverlayOp; //导入方法依赖的package包/类
/**
* Computes a <coe>Geometry </code> representing the closure of the point-set
* which is the union of the points in this <code>Geometry</code> which are not
* contained in the <code>other</code> Geometry,
* with the points in the <code>other</code> Geometry not contained in this
* <code>Geometry</code>.
* If the result is empty, it is an atomic geometry
* with the dimension of the highest input dimension.
* <p/>
* Non-empty {@link GeometryCollection} arguments are not supported.
*
* @param other the <code>Geometry</code> with which to compute the symmetric
* difference
* @return a Geometry representing the point-set symmetric 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 symDifference(Geometry other) {
// handle empty geometry cases
if (this.isEmpty() || other.isEmpty()) {
// both empty - check dimensions
if (this.isEmpty() && other.isEmpty())
return OverlayOp.createEmptyResult(OverlayOp.SYMDIFFERENCE, this, other, factory);
// special case: if either input is empty ==> result = other arg
if (this.isEmpty()) return (Geometry) other.clone();
if (other.isEmpty()) return (Geometry) clone();
}
checkNotGeometryCollection(this);
checkNotGeometryCollection(other);
return SnapIfNeededOverlayOp.overlayOp(this, other, OverlayOp.SYMDIFFERENCE);
}
示例8: union
import com.vividsolutions.jts.operation.overlay.OverlayOp; //导入方法依赖的package包/类
/**
* Computes a <code>Geometry</code> representing the point-set
* which is contained in both this
* <code>Geometry</code> and the <code>other</code> Geometry.
* <p>
* The union of two geometries of different dimension produces a result
* geometry of dimension equal to the maximum dimension of the input
* geometries.
* The result geometry may be a heterogenous
* {@link GeometryCollection}.
* If the result is empty, it is an atomic geometry
* with the dimension of the highest input dimension.
* <p>
* Unioning {@link LineString}s has the effect of
* <b>noding</b> and <b>dissolving</b> the input linework. In this context
* "noding" means that there will be a node or endpoint in the result for
* every endpoint or line segment crossing in the input. "Dissolving" means
* that any duplicate (i.e. coincident) line segments or portions of line
* segments will be reduced to a single line segment in the result.
* If <b>merged</b> linework is required, the {@link LineMerger}
* class can be used.
* <p>
* Non-empty {@link GeometryCollection} arguments are not supported.
*
* @param other
* the <code>Geometry</code> with which to compute the union
* @return a point-set combining the points of this <code>Geometry</code> and the
* points of <code>other</code>
* @throws TopologyException
* if a robustness error occurs
* @throws IllegalArgumentException
* if either input is a non-empty GeometryCollection
* @see LineMerger
*/
public Geometry union(Geometry other)
{
// handle empty geometry cases
if (this.isEmpty() || other.isEmpty()) {
if (this.isEmpty() && other.isEmpty())
return OverlayOp.createEmptyResult(OverlayOp.UNION, this, other, factory);
// special case: if either input is empty ==> other input
if (this.isEmpty()) return (Geometry) other.clone();
if (other.isEmpty()) return (Geometry) clone();
}
// TODO: optimize if envelopes of geometries do not intersect
checkNotGeometryCollection(this);
checkNotGeometryCollection(other);
return SnapIfNeededOverlayOp.overlayOp(this, other, OverlayOp.UNION);
}
示例9: symDifference
import com.vividsolutions.jts.operation.overlay.OverlayOp; //导入方法依赖的package包/类
/**
* Computes a <coe>Geometry </code> representing the closure of the point-set
* which is the union of the points in this <code>Geometry</code> which are not
* contained in the <code>other</code> Geometry,
* with the points in the <code>other</code> Geometry not contained in this
* <code>Geometry</code>.
* If the result is empty, it is an atomic geometry
* with the dimension of the highest input dimension.
* <p>
* Non-empty {@link GeometryCollection} arguments are not supported.
*
*@param other the <code>Geometry</code> with which to compute the symmetric
* difference
*@return a Geometry representing the point-set symmetric 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 symDifference(Geometry other)
{
// handle empty geometry cases
if (this.isEmpty() || other.isEmpty()) {
// both empty - check dimensions
if (this.isEmpty() && other.isEmpty())
return OverlayOp.createEmptyResult(OverlayOp.SYMDIFFERENCE, this, other, factory);
// special case: if either input is empty ==> result = other arg
if (this.isEmpty()) return (Geometry) other.clone();
if (other.isEmpty()) return (Geometry) clone();
}
checkNotGeometryCollection(this);
checkNotGeometryCollection(other);
return SnapIfNeededOverlayOp.overlayOp(this, other, OverlayOp.SYMDIFFERENCE);
}
示例10: difference
import com.vividsolutions.jts.operation.overlay.OverlayOp; //导入方法依赖的package包/类
/**
* 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, this.factory);
}
if (other.isEmpty()) {
return (Geometry) this.clone();
}
this.checkNotGeometryCollection(this);
this.checkNotGeometryCollection(other);
return SnapIfNeededOverlayOp.overlayOp(this, other, OverlayOp.DIFFERENCE);
}
示例11: difference
import com.vividsolutions.jts.operation.overlay.OverlayOp; //导入方法依赖的package包/类
/**
* 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);
}
示例12: difference
import com.vividsolutions.jts.operation.overlay.OverlayOp; //导入方法依赖的package包/类
/**
* 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);
}