当前位置: 首页>>代码示例>>Java>>正文


Java LineString.isClosed方法代码示例

本文整理汇总了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);
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:32,代码来源:LineSequencer.java

示例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()
    });
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:20,代码来源:BoundaryOp.java

示例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;
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:19,代码来源:PointLocator.java

示例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);
    }
}
 
开发者ID:gegy1000,项目名称:Earth,代码行数:16,代码来源:TopologyPreservingSimplifier.java


注:本文中的com.vividsolutions.jts.geom.LineString.isClosed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。