本文整理汇总了Java中com.vividsolutions.jts.geom.LineString.isClosed方法的典型用法代码示例。如果您正苦于以下问题:Java LineString.isClosed方法的具体用法?Java LineString.isClosed怎么用?Java LineString.isClosed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vividsolutions.jts.geom.LineString
的用法示例。
在下文中一共展示了LineString.isClosed方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildSequencedGeometry
import com.vividsolutions.jts.geom.LineString; //导入方法依赖的package包/类
/**
* Builds a geometry ({@link LineString} or {@link MultiLineString} )
* representing the sequence.
*
* @param sequences a List of Lists of DirectedEdges with
* LineMergeEdges as their parent edges.
* @return the sequenced geometry, or <code>null</code> if no sequence exists
*/
private Geometry buildSequencedGeometry(List sequences) {
List lines = new ArrayList();
for (Object sequence : sequences) {
List seq = (List) sequence;
for (Object aSeq : seq) {
DirectedEdge de = (DirectedEdge) aSeq;
LineMergeEdge e = (LineMergeEdge) de.getEdge();
LineString line = e.getLine();
LineString lineToAdd = line;
if (!de.getEdgeDirection() && !line.isClosed()) {
lineToAdd = reverse(line);
}
lines.add(lineToAdd);
}
}
if (lines.size() == 0) {
return this.factory.createMultiLineString(new LineString[0]);
}
return this.factory.buildGeometry(lines);
}
示例2: boundaryLineString
import com.vividsolutions.jts.geom.LineString; //导入方法依赖的package包/类
private Geometry boundaryLineString(LineString line) {
if (this.geom.isEmpty()) {
return this.getEmptyMultiPoint();
}
if (line.isClosed()) {
// check whether endpoints of valence 2 are on the boundary or not
boolean closedEndpointOnBoundary = this.bnRule.isInBoundary(2);
if (closedEndpointOnBoundary) {
return line.getStartPoint();
} else {
return this.geomFact.createMultiPoint((Coordinate[]) null);
}
}
return this.geomFact.createMultiPoint(new Point[] {
line.getStartPoint(),
line.getEndPoint()
});
}
示例3: locate
import com.vividsolutions.jts.geom.LineString; //导入方法依赖的package包/类
private int locate(Coordinate p, LineString l) {
// bounding-box check
if (!l.getEnvelopeInternal().intersects(p)) {
return Location.EXTERIOR;
}
Coordinate[] pt = l.getCoordinates();
if (!l.isClosed()) {
if (p.equals(pt[0])
|| p.equals(pt[pt.length - 1])) {
return Location.BOUNDARY;
}
}
if (CGAlgorithms.isOnLine(p, pt)) {
return Location.INTERIOR;
}
return Location.EXTERIOR;
}
示例4: filter
import com.vividsolutions.jts.geom.LineString; //导入方法依赖的package包/类
/**
* Filters linear geometries.
* <p>
* geom a geometry of any type
*/
@Override
public void filter(Geometry geom) {
if (geom instanceof LineString) {
LineString line = (LineString) geom;
int minSize = line.isClosed() ? 4 : 2;
TaggedLineString taggedLine = new TaggedLineString(line, minSize);
TopologyPreservingSimplifier.this.linestringMap.put(line, taggedLine);
}
}