Search in sources :

Example 1 with BasicSegmentString

use of com.revolsys.geometry.noding.BasicSegmentString in project com.revolsys.open by revolsys.

the class NodingFunctions method newSegmentStrings.

private static List<SegmentString> newSegmentStrings(final Geometry geom) {
    final List<SegmentString> segs = new ArrayList<>();
    final List<LineString> lines = geom.getGeometries(LineString.class);
    for (final LineString line : lines) {
        segs.add(new BasicSegmentString(line, null));
    }
    return segs;
}
Also used : LineString(com.revolsys.geometry.model.LineString) ArrayList(java.util.ArrayList) BasicSegmentString(com.revolsys.geometry.noding.BasicSegmentString) SegmentString(com.revolsys.geometry.noding.SegmentString) BasicSegmentString(com.revolsys.geometry.noding.BasicSegmentString) NodedSegmentString(com.revolsys.geometry.noding.NodedSegmentString)

Example 2 with BasicSegmentString

use of com.revolsys.geometry.noding.BasicSegmentString in project com.revolsys.open by revolsys.

the class MCIndexedPointInAreaLocator method addLine.

private void addLine(final LineString points) {
    final SegmentString segStr = new BasicSegmentString(points, null);
    final List<MonotoneChain> chains = MonotoneChainBuilder.getChains(segStr.getLineString(), segStr);
    for (final MonotoneChain chain : chains) {
        this.index.insertItem(chain);
    }
}
Also used : MonotoneChain(com.revolsys.geometry.index.chain.MonotoneChain) BasicSegmentString(com.revolsys.geometry.noding.BasicSegmentString) SegmentString(com.revolsys.geometry.noding.SegmentString) BasicSegmentString(com.revolsys.geometry.noding.BasicSegmentString)

Aggregations

BasicSegmentString (com.revolsys.geometry.noding.BasicSegmentString)2 SegmentString (com.revolsys.geometry.noding.SegmentString)2 MonotoneChain (com.revolsys.geometry.index.chain.MonotoneChain)1 LineString (com.revolsys.geometry.model.LineString)1 NodedSegmentString (com.revolsys.geometry.noding.NodedSegmentString)1 ArrayList (java.util.ArrayList)1