本文整理匯總了Java中com.vividsolutions.jts.geom.GeometryFactory.createMultiLineString方法的典型用法代碼示例。如果您正苦於以下問題:Java GeometryFactory.createMultiLineString方法的具體用法?Java GeometryFactory.createMultiLineString怎麽用?Java GeometryFactory.createMultiLineString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vividsolutions.jts.geom.GeometryFactory
的用法示例。
在下文中一共展示了GeometryFactory.createMultiLineString方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: nodeLines
import com.vividsolutions.jts.geom.GeometryFactory; //導入方法依賴的package包/類
public Collection<Geometry> nodeLines(final Collection<Geometry> lines) {
final GeometryFactory gf = new GeometryFactory();
final Geometry linesGeom = gf.createMultiLineString(GeometryFactory
.toLineStringArray(lines));
Geometry unionInput = gf.createMultiLineString(null);
final Geometry point = extractPoint(lines);
if (point != null)
unionInput = point;
final Geometry noded = linesGeom.union(unionInput);
final List<Geometry> nodedList = new ArrayList<Geometry>();
nodedList.add(noded);
return nodedList;
}
示例2: smoothMultiLineString
import com.vividsolutions.jts.geom.GeometryFactory; //導入方法依賴的package包/類
private static Geometry smoothMultiLineString(GeometryFactory factory,
GeometrySmoother smoother, Geometry geom, double fit) {
final int N = geom.getNumGeometries();
LineString[] smoothed = new LineString[N];
for (int i = 0; i < N; i++) {
smoothed[i] = (LineString) smoothLineString(factory, smoother, geom.getGeometryN(i),
fit);
}
return factory.createMultiLineString(smoothed);
}
示例3: lines
import com.vividsolutions.jts.geom.GeometryFactory; //導入方法依賴的package包/類
public static Geometry lines(List<LineString> lineStrings,
GeometryFactory factory) {
if (lineStrings.size() == 1) {
return lineStrings.get(0);
}
return factory.createMultiLineString(lineStrings
.toArray(new LineString[lineStrings.size()]));
}
示例4: getEdges
import com.vividsolutions.jts.geom.GeometryFactory; //導入方法依賴的package包/類
/**
* Gets the geometry for the edges in the subdivision as a {@link MultiLineString}
* containing 2-point lines.
*
* @param geomFact the GeometryFactory to use
* @return a MultiLineString
*/
public Geometry getEdges(GeometryFactory geomFact) {
List quadEdges = this.getPrimaryEdges(false);
LineString[] edges = new LineString[quadEdges.size()];
int i = 0;
for (Object quadEdge : quadEdges) {
QuadEdge qe = (QuadEdge) quadEdge;
edges[i++] = geomFact.createLineString(new Coordinate[] {
qe.orig().getCoordinate(), qe.dest().getCoordinate() });
}
return geomFact.createMultiLineString(edges);
}
示例5: createMultiLineString
import com.vividsolutions.jts.geom.GeometryFactory; //導入方法依賴的package包/類
public static MultiLineString createMultiLineString(
List<LineString> lineStrings, GeometryFactory factory) {
LineString[] strings = lineStrings.toArray(new LineString[lineStrings
.size()]);
return factory.createMultiLineString(strings);
}