本文整理匯總了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(")");
}
}