本文整理匯總了Java中com.vividsolutions.jts.noding.Noder.getNodedSubstrings方法的典型用法代碼示例。如果您正苦於以下問題:Java Noder.getNodedSubstrings方法的具體用法?Java Noder.getNodedSubstrings怎麽用?Java Noder.getNodedSubstrings使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vividsolutions.jts.noding.Noder
的用法示例。
在下文中一共展示了Noder.getNodedSubstrings方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: computeNodedEdges
import com.vividsolutions.jts.noding.Noder; //導入方法依賴的package包/類
private void computeNodedEdges(List bufferSegStrList, PrecisionModel precisionModel) {
Noder noder = this.getNoder(precisionModel);
noder.computeNodes(bufferSegStrList);
Collection nodedSegStrings = noder.getNodedSubstrings();
// DEBUGGING ONLY
//BufferDebug.saveEdges(nodedEdges, "run" + BufferDebug.runCount + "_nodedEdges");
for (Object nodedSegString : nodedSegStrings) {
SegmentString segStr = (SegmentString) nodedSegString;
/**
* Discard edges which have zero length,
* since they carry no information and cause problems with topology building
*/
Coordinate[] pts = segStr.getCoordinates();
if (pts.length == 2 && pts[0].equals2D(pts[1])) {
continue;
}
Label oldLabel = (Label) segStr.getData();
Edge edge = new Edge(segStr.getCoordinates(), new Label(oldLabel));
this.insertUniqueEdge(edge);
}
//saveEdges(edgeList.getEdges(), "run" + runCount + "_collapsedEdges");
}
示例2: node
import com.vividsolutions.jts.noding.Noder; //導入方法依賴的package包/類
/**
* Nodes the linework of a set of Geometrys using SnapRounding.
*
* @param geoms a Collection of Geometrys of any type
* @return a List of LineStrings representing the noded linework of the input
*/
public List node(Collection geoms) {
// get geometry factory
Geometry geom0 = (Geometry) geoms.iterator().next();
this.geomFact = geom0.getFactory();
List segStrings = this.toSegmentStrings(this.extractLines(geoms));
//Noder sr = new SimpleSnapRounder(pm);
Noder sr = new MCIndexSnapRounder(this.pm);
sr.computeNodes(segStrings);
Collection nodedLines = sr.getNodedSubstrings();
//TODO: improve this to check for full snap-rounded correctness
if (this.isValidityChecked) {
NodingValidator nv = new NodingValidator(nodedLines);
nv.checkValid();
}
return this.toLineStrings(nodedLines);
}
示例3: computeNodedEdges
import com.vividsolutions.jts.noding.Noder; //導入方法依賴的package包/類
private void computeNodedEdges(List bufferSegStrList, PrecisionModel precisionModel) {
Noder noder = getNoder(precisionModel);
noder.computeNodes(bufferSegStrList);
Collection nodedSegStrings = noder.getNodedSubstrings();
// DEBUGGING ONLY
//BufferDebug.saveEdges(nodedEdges, "run" + BufferDebug.runCount + "_nodedEdges");
for (Iterator i = nodedSegStrings.iterator(); i.hasNext(); ) {
SegmentString segStr = (SegmentString) i.next();
/**
* Discard edges which have zero length,
* since they carry no information and cause problems with topology building
*/
Coordinate[] pts = segStr.getCoordinates();
if (pts.length == 2 && pts[0].equals2D(pts[1]))
continue;
Label oldLabel = (Label) segStr.getData();
Edge edge = new Edge(segStr.getCoordinates(), new Label(oldLabel));
insertUniqueEdge(edge);
}
//saveEdges(edgeList.getEdges(), "run" + runCount + "_collapsedEdges");
}
示例4: node
import com.vividsolutions.jts.noding.Noder; //導入方法依賴的package包/類
/**
* Nodes the linework of a set of Geometrys using SnapRounding.
*
* @param geoms a Collection of Geometrys of any type
* @return a List of LineStrings representing the noded linework of the input
*/
public List node(Collection geoms) {
// get geometry factory
Geometry geom0 = (Geometry) geoms.iterator().next();
geomFact = geom0.getFactory();
List segStrings = toSegmentStrings(extractLines(geoms));
//Noder sr = new SimpleSnapRounder(pm);
Noder sr = new MCIndexSnapRounder(pm);
sr.computeNodes(segStrings);
Collection nodedLines = sr.getNodedSubstrings();
//TODO: improve this to check for full snap-rounded correctness
if (isValidityChecked) {
NodingValidator nv = new NodingValidator(nodedLines);
nv.checkValid();
}
return toLineStrings(nodedLines);
}