本文整理汇总了Java中com.vividsolutions.jts.triangulate.quadedge.LocateFailureException类的典型用法代码示例。如果您正苦于以下问题:Java LocateFailureException类的具体用法?Java LocateFailureException怎么用?Java LocateFailureException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LocateFailureException类属于com.vividsolutions.jts.triangulate.quadedge包,在下文中一共展示了LocateFailureException类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: iterateOverTriangles
import com.vividsolutions.jts.triangulate.quadedge.LocateFailureException; //导入依赖的package包/类
public static void iterateOverTriangles(final Polygon polygon, final Consumer<Geometry> action) {
final double elevation = getContourCoordinates(polygon).averageZ();
final double sizeTol = FastMath.sqrt(polygon.getArea()) / 100.0;
final DelaunayTriangulationBuilder dtb = new DelaunayTriangulationBuilder();
final PreparedGeometry buffered = PREPARED_GEOMETRY_FACTORY.create(polygon.buffer(sizeTol, 5, 0));
final Envelope3D env = Envelope3D.of(buffered.getGeometry());
try {
dtb.setSites(polygon);
dtb.setTolerance(sizeTol);
applyToInnerGeometries(dtb.getTriangles(GEOMETRY_FACTORY), (gg) -> {
final ICoordinates cc = getContourCoordinates(gg);
if (cc.isCoveredBy(env) && buffered.covers(gg)) {
cc.setAllZ(elevation);
gg.geometryChanged();
action.accept(gg);
}
});
} catch (final LocateFailureException | ConstraintEnforcementException e) {
final IScope scope = GAMA.getRuntimeScope();
GamaRuntimeException.warning("Impossible to triangulate: " + new WKTWriter().write(polygon), scope);
iterateOverTriangles((Polygon) DouglasPeuckerSimplifier.simplify(polygon, 0.1), action);
return;
}
}
开发者ID:gama-platform,项目名称:gama,代码行数:25,代码来源:GeometryUtils.java
注:本文中的com.vividsolutions.jts.triangulate.quadedge.LocateFailureException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论