public void CreatVoronoi(IFeatureClass pointFeaCls,IFeatureClass voronoiFeaCls,IPolygon clippingPolygon){
try {
if (pointFeaCls.getShapeType() == esriGeometryType.esriGeometryPoint)
{
if(pointFeaCls.featureCount(null)>2)
{
//
FeatureClass fc=new FeatureClass(pointFeaCls);
IEnvelope pEnv =clippingPolygon.getEnvelope();// (IEnvelope)fc.getExtent();
pEnv.setSpatialReferenceByRef(clippingPolygon.getSpatialReference());
ITinEdit pTinEdit = new Tin();
pTinEdit.initNew(pEnv);
pTinEdit.addFromFeatureClass(pointFeaCls, null, pointFeaCls.getFields().getField(0) , null, esriTinSurfaceType.esriTinMassPoint, null);
pTinEdit.refresh();
ITinNodeCollection pTinNodeCollection = (ITinNodeCollection)pTinEdit;
pTinNodeCollection.convertToVoronoiRegions(voronoiFeaCls, null, clippingPolygon,"","");
System.out.println("voronoiFeaCls:"+voronoiFeaCls.featureCount(null));
}
else
System.out.println("必须输入至少3个点!");
}
else
System.out.println("必须输入点数据!");
} catch (AutomationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// return voronoiFeaCls;
}
---------------------
作者:zhizhu8256
来源:CSDN
原文:https://blog.csdn.net/zhizhu8256/article/details/36645873
版权声明:本文为博主原创文章,转载请附上博文链接!
Java调用AE实现创建泰森多边形(voronoi图)
猜你喜欢
转载自blog.csdn.net/Sun_xiangyan/article/details/86531989
今日推荐
周排行