ArcEngine 中使用 Geoprocessing
方法一、注意inputfeatrue和clipfeatureclass 裁剪顺序
public static IFeatureClass Clip(IFeatureClass inputfeatrue,IFeatureClass clipfeatureclass , string outFcName)
{
try
{
//开始剪切,设置容限值为0,系统默认容限值为当前DataFrame的空间域范围的1万分之一
IBasicGeoprocessor basicGeoprocessor = new BasicGeoprocessorClass();
basicGeoprocessor.SpatialReference = (clipfeatureclass as IGeoDataset).SpatialReference;
//裁剪得到重叠的几何图形
IFeatureClass outFeatureClass = basicGeoprocessor.Clip(clipfeatureclass as ITable, false, inputfeatrue as ITable, false, 0.01, IFeatureClassName outFeatureClassName);
return outFeatureClass;
}
catch (Exception ms)
{
throw ms;
}
}
方法二、更多见http://www.blogjava.net/flyingis/archive/2007/04/04/108483.html
import com.esri.arcgis.geoprocessing.GeoProcessor;
import com.esri.arcgis.geoprocessing.tools.analysistools.Clip;
// Initialize the GeoProcessor
GeoProcessor gp = new GeoProcessor();
Clip clip= new Clip("c:/data/mjrroads.shp", "c:/data/coasts.shp", "c:/output/clipOutput.shp");