I am trying to use idw geoprocessing tools to generate a raster file, but it doesn't work fine for me. I have got a input point shapefile named "TrafficMap_Count.shp" which has a WGS84 coordinate reference.Here is my code
String inShpFilePath = "D:\\ArcWorkspace";String inShpFileName = "TrafficMap_Count.shp";String outRasterFileName = "D:\\ArcWorkspace\\TrafficMap.tif";ShapefileWorkspaceFactory shapefileWorkspaceFactory = new ShapefileWorkspaceFactory();Workspace workspace = (Workspace) shapefileWorkspaceFactory.openFromFile(inShpFilePath, 0);FeatureClass featureClass = new FeatureClass(workspace.openFeatureClass(inShpFileName));GeoProcessor gp = new GeoProcessor();Idw idw = new Idw();idw.setInPointFeatures(featureClass);idw.setCellSize(Double.valueOf(0.00001));idw.setZField("gridRSCP");idw.setOutRaster(outRasterFileName);idw.setPower(2);RasterRadius rasterRadius = new RasterRadius();rasterRadius.setFixed(0.0005, new Integer(0));idw.setSearchRadius(rasterRadius);gp.execute(idw, null);I get error message like this:
AutomationException: 0x80004005 - Unspecified errorat com.esri.arcgis.geoprocessing.GeoProcessor.execute(Unknown Source)at com.esri.arcgis.geoprocessing.GeoProcessor.execute(Unknown Source)I guess something get wrong with code
idw.setSearchRadius(rasterRadius);because if I delete it, the program can run successfully, but why? I am confused. Any help will be greateful.
أكثر...
String inShpFilePath = "D:\\ArcWorkspace";String inShpFileName = "TrafficMap_Count.shp";String outRasterFileName = "D:\\ArcWorkspace\\TrafficMap.tif";ShapefileWorkspaceFactory shapefileWorkspaceFactory = new ShapefileWorkspaceFactory();Workspace workspace = (Workspace) shapefileWorkspaceFactory.openFromFile(inShpFilePath, 0);FeatureClass featureClass = new FeatureClass(workspace.openFeatureClass(inShpFileName));GeoProcessor gp = new GeoProcessor();Idw idw = new Idw();idw.setInPointFeatures(featureClass);idw.setCellSize(Double.valueOf(0.00001));idw.setZField("gridRSCP");idw.setOutRaster(outRasterFileName);idw.setPower(2);RasterRadius rasterRadius = new RasterRadius();rasterRadius.setFixed(0.0005, new Integer(0));idw.setSearchRadius(rasterRadius);gp.execute(idw, null);I get error message like this:
AutomationException: 0x80004005 - Unspecified errorat com.esri.arcgis.geoprocessing.GeoProcessor.execute(Unknown Source)at com.esri.arcgis.geoprocessing.GeoProcessor.execute(Unknown Source)I guess something get wrong with code
idw.setSearchRadius(rasterRadius);because if I delete it, the program can run successfully, but why? I am confused. Any help will be greateful.
أكثر...