本文整理汇总了Java中com.vividsolutions.jts.geom.MultiPoint.isEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java MultiPoint.isEmpty方法的具体用法?Java MultiPoint.isEmpty怎么用?Java MultiPoint.isEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vividsolutions.jts.geom.MultiPoint
的用法示例。
在下文中一共展示了MultiPoint.isEmpty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isSimpleMultiPoint
import com.vividsolutions.jts.geom.MultiPoint; //导入方法依赖的package包/类
private boolean isSimpleMultiPoint(MultiPoint mp) {
if (mp.isEmpty()) {
return true;
}
Set points = new TreeSet();
for (int i = 0; i < mp.getNumGeometries(); i++) {
Point pt = (Point) mp.getGeometryN(i);
Coordinate p = pt.getCoordinate();
if (points.contains(p)) {
this.nonSimpleLocation = p;
return false;
}
points.add(p);
}
return true;
}
示例2: appendMultiPointText
import com.vividsolutions.jts.geom.MultiPoint; //导入方法依赖的package包/类
/**
* Converts a <code>MultiPoint</code> to <MultiPoint Text> format, then
* appends it to the writer.
*
* @param multiPoint the <code>MultiPoint</code> to process
* @param writer the output writer to append to
*/
private void appendMultiPointText(MultiPoint multiPoint, int level, Writer writer)
throws IOException {
if (multiPoint.isEmpty()) {
writer.write("EMPTY");
} else {
writer.write("(");
for (int i = 0; i < multiPoint.getNumGeometries(); i++) {
if (i > 0) {
writer.write(", ");
this.indentCoords(i, level + 1, writer);
}
writer.write("(");
this.appendCoordinate(multiPoint.getGeometryN(i).getCoordinate(), writer);
writer.write(")");
}
writer.write(")");
}
}