Import ArcGIS.ConversionTools and ArcGIS.Geoprocessor then pass the file paths as param into following function you will get the resulting raster out of shapefile.
using ESRI.ArcGIS.ConversionTools;
using ESRI.ArcGIS.Geoprocessor;
public static void Rasterize(string inputFeature, string outRaster, string fieldName, int cellSize)
{
//Runtime manager to find the ESRI product installed in the system
ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.Desktop);
Geoprocessor geoprocessor = new Geoprocessor();
geoprocessor.OverwriteOutput = true;
FeatureToRaster featureToRaster = new FeatureToRaster();
featureToRaster.cell_size = cellSize;
featureToRaster.in_features = inputFeature;
featureToRaster.out_raster = outRaster;
featureToRaster.field = fieldName;
geoprocessor.Execute(featureToRaster, null);
}
0 comments :
Post a Comment