本文整理汇总了Java中com.vividsolutions.jts.geom.IntersectionMatrix.set方法的典型用法代码示例。如果您正苦于以下问题:Java IntersectionMatrix.set方法的具体用法?Java IntersectionMatrix.set怎么用?Java IntersectionMatrix.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vividsolutions.jts.geom.IntersectionMatrix
的用法示例。
在下文中一共展示了IntersectionMatrix.set方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: computeDisjointIM
import com.vividsolutions.jts.geom.IntersectionMatrix; //导入方法依赖的package包/类
/**
* If the Geometries are disjoint, we need to enter their dimension and
* boundary dimension in the Ext rows in the IM
*/
private void computeDisjointIM(IntersectionMatrix im) {
Geometry ga = this.arg[0].getGeometry();
if (!ga.isEmpty()) {
im.set(Location.INTERIOR, Location.EXTERIOR, ga.getDimension());
im.set(Location.BOUNDARY, Location.EXTERIOR, ga.getBoundaryDimension());
}
Geometry gb = this.arg[1].getGeometry();
if (!gb.isEmpty()) {
im.set(Location.EXTERIOR, Location.INTERIOR, gb.getDimension());
im.set(Location.EXTERIOR, Location.BOUNDARY, gb.getBoundaryDimension());
}
}
示例2: computeDisjointIM
import com.vividsolutions.jts.geom.IntersectionMatrix; //导入方法依赖的package包/类
/**
* If the Geometries are disjoint, we need to enter their dimension and
* boundary dimension in the Ext rows in the IM
*/
private void computeDisjointIM(IntersectionMatrix im) {
Geometry ga = arg[0].getGeometry();
if (!ga.isEmpty()) {
im.set(Location.INTERIOR, Location.EXTERIOR, ga.getDimension());
im.set(Location.BOUNDARY, Location.EXTERIOR, ga.getBoundaryDimension());
}
Geometry gb = arg[1].getGeometry();
if (!gb.isEmpty()) {
im.set(Location.EXTERIOR, Location.INTERIOR, gb.getDimension());
im.set(Location.EXTERIOR, Location.BOUNDARY, gb.getBoundaryDimension());
}
}
示例3: computeIM
import com.vividsolutions.jts.geom.IntersectionMatrix; //导入方法依赖的package包/类
public IntersectionMatrix computeIM() {
IntersectionMatrix im = new IntersectionMatrix();
// since Geometries are finite and embedded in a 2-D space, the EE element must always be 2
im.set(Location.EXTERIOR, Location.EXTERIOR, 2);
// if the Geometries don't overlap there is nothing to do
if (!this.arg[0].getGeometry().getEnvelopeInternal().intersects(
this.arg[1].getGeometry().getEnvelopeInternal())) {
this.computeDisjointIM(im);
return im;
}
this.arg[0].computeSelfNodes(this.li, false);
this.arg[1].computeSelfNodes(this.li, false);
// compute intersections between edges of the two input geometries
SegmentIntersector intersector = this.arg[0].computeEdgeIntersections(this.arg[1], this.li, false);
//System.out.println("computeIM: # segment intersection tests: " + intersector.numTests);
this.computeIntersectionNodes(0);
this.computeIntersectionNodes(1);
/**
* Copy the labelling for the nodes in the parent Geometries. These override
* any labels determined by intersections between the geometries.
*/
this.copyNodesAndLabels(0);
this.copyNodesAndLabels(1);
// complete the labelling for any nodes which only have a label for a single geometry
//Debug.addWatch(nodes.find(new Coordinate(110, 200)));
//Debug.printWatch();
this.labelIsolatedNodes();
//Debug.printWatch();
// If a proper intersection was found, we can set a lower bound on the IM.
this.computeProperIntersectionIM(intersector, im);
/**
* Now process improper intersections
* (eg where one or other of the geometries has a vertex at the intersection point)
* We need to compute the edge graph at all nodes to determine the IM.
*/
// build EdgeEnds for all intersections
EdgeEndBuilder eeBuilder = new EdgeEndBuilder();
List ee0 = eeBuilder.computeEdgeEnds(this.arg[0].getEdgeIterator());
this.insertEdgeEnds(ee0);
List ee1 = eeBuilder.computeEdgeEnds(this.arg[1].getEdgeIterator());
this.insertEdgeEnds(ee1);
//Debug.println("==== NodeList ===");
//Debug.print(nodes);
this.labelNodeEdges();
/**
* Compute the labeling for isolated components
* <br>
* Isolated components are components that do not touch any other components in the graph.
* They can be identified by the fact that they will
* contain labels containing ONLY a single element, the one for their parent geometry.
* We only need to check components contained in the input graphs, since
* isolated components will not have been replaced by new components formed by intersections.
*/
//debugPrintln("Graph A isolated edges - ");
this.labelIsolatedEdges(0, 1);
//debugPrintln("Graph B isolated edges - ");
this.labelIsolatedEdges(1, 0);
// update the IM from all components
this.updateIM(im);
return im;
}
示例4: computeIM
import com.vividsolutions.jts.geom.IntersectionMatrix; //导入方法依赖的package包/类
public IntersectionMatrix computeIM() {
IntersectionMatrix im = new IntersectionMatrix();
// since Geometries are finite and embedded in a 2-D space, the EE element must always be 2
im.set(Location.EXTERIOR, Location.EXTERIOR, 2);
// if the Geometries don't overlap there is nothing to do
if (!arg[0].getGeometry().getEnvelopeInternal().intersects(
arg[1].getGeometry().getEnvelopeInternal())) {
computeDisjointIM(im);
return im;
}
arg[0].computeSelfNodes(li, false);
arg[1].computeSelfNodes(li, false);
// compute intersections between edges of the two input geometries
SegmentIntersector intersector = arg[0].computeEdgeIntersections(arg[1], li, false);
//System.out.println("computeIM: # segment intersection tests: " + intersector.numTests);
computeIntersectionNodes(0);
computeIntersectionNodes(1);
/**
* Copy the labelling for the nodes in the parent Geometries. These override
* any labels determined by intersections between the geometries.
*/
copyNodesAndLabels(0);
copyNodesAndLabels(1);
// complete the labelling for any nodes which only have a label for a single geometry
//Debug.addWatch(nodes.find(new Coordinate(110, 200)));
//Debug.printWatch();
labelIsolatedNodes();
//Debug.printWatch();
// If a proper intersection was found, we can set a lower bound on the IM.
computeProperIntersectionIM(intersector, im);
/**
* Now process improper intersections
* (eg where one or other of the geometries has a vertex at the intersection point)
* We need to compute the edge graph at all nodes to determine the IM.
*/
// build EdgeEnds for all intersections
EdgeEndBuilder eeBuilder = new EdgeEndBuilder();
List ee0 = eeBuilder.computeEdgeEnds(arg[0].getEdgeIterator());
insertEdgeEnds(ee0);
List ee1 = eeBuilder.computeEdgeEnds(arg[1].getEdgeIterator());
insertEdgeEnds(ee1);
//Debug.println("==== NodeList ===");
//Debug.print(nodes);
labelNodeEdges();
/**
* Compute the labeling for isolated components
* <br>
* Isolated components are components that do not touch any other components in the graph.
* They can be identified by the fact that they will
* contain labels containing ONLY a single element, the one for their parent geometry.
* We only need to check components contained in the input graphs, since
* isolated components will not have been replaced by new components formed by intersections.
*/
//debugPrintln("Graph A isolated edges - ");
labelIsolatedEdges(0, 1);
//debugPrintln("Graph B isolated edges - ");
labelIsolatedEdges(1, 0);
// update the IM from all components
updateIM(im);
return im;
}