本文整理汇总了Java中com.vividsolutions.jts.geom.GeometryFilter类的典型用法代码示例。如果您正苦于以下问题:Java GeometryFilter类的具体用法?Java GeometryFilter怎么用?Java GeometryFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GeometryFilter类属于com.vividsolutions.jts.geom包,在下文中一共展示了GeometryFilter类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: flatten
import com.vividsolutions.jts.geom.GeometryFilter; //导入依赖的package包/类
/** */
public static Geometry flatten (GeometryCollection gc) {
final List<Point> points = new LinkedList<Point>();
final List<LineString> lines = new LinkedList<LineString>();
final List<Polygon> polygons = new LinkedList<Polygon>();
gc.apply(new GeometryFilter() {
public void filter (Geometry geom) {
if (geom instanceof Point) {
points.add((Point)geom);
} else if (geom instanceof LineString) {
lines.add((LineString)geom);
} else if (geom instanceof Polygon) {
polygons.add((Polygon)geom);
}
}
});
if (!polygons.isEmpty()) {
return gc.getFactory().createMultiPolygon(GeometryFactory.toPolygonArray(polygons));
} else if (!lines.isEmpty()) {
return gc.getFactory().createMultiLineString(GeometryFactory.toLineStringArray(lines));
} else {
return gc.getFactory().createMultiPoint(GeometryFactory.toPointArray(points));
}
}
示例2: applyToInnerGeometries
import com.vividsolutions.jts.geom.GeometryFilter; //导入依赖的package包/类
public static void applyToInnerGeometries(final Polygon g, final GeometryFilter f) {
final int holes = g.getNumInteriorRing();
if (holes == 0)
return;
for (int i = 0; i < holes; i++) {
g.getInteriorRingN(i).apply(f);
}
}
示例3: apply
import com.vividsolutions.jts.geom.GeometryFilter; //导入依赖的package包/类
@Override
public void apply(final GeometryFilter filter) {
filter.filter(this);
}
示例4: drawSimpleGeometry
import com.vividsolutions.jts.geom.GeometryFilter; //导入依赖的package包/类
void drawSimpleGeometry(final OpenGL gl, final Geometry geom) throws ExecutionException {
geom.apply((GeometryFilter) (g) -> drawer.accept(g));
}
示例5: apply
import com.vividsolutions.jts.geom.GeometryFilter; //导入依赖的package包/类
@Override
public void apply(GeometryFilter filter) {
// Do nothing. This circle is not expected to be a complete geometry.
}