當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。