Select to view content in your preferred language

How to specify snap distance parameter using SnapPourPoint GP Tool in ArcGIS Pro SDK?

603
2
Jump to solution
06-26-2023 07:59 AM
AquanuityDevelopment
New Contributor III

The following code with a snap distance of 5 will fail with error code 2147483647.  But if I remove the parameter.  It will be working fine.  Any ideas how to bypass this issue?

 

string sIputRaster = @"C:\Support\PourPoints.tif";

string sFlowAccumRaster = @"C:\Support\FlowAccumulation.tif";
string sRaterPath = @"C:\Support\Snap.tif";

var parameters = Geoprocessing.MakeValueArray(sIputRaster, sFlowAccumRaster, 5, sRaterPath);

var cts = new CancellationTokenSource();
var results = await Geoprocessing.ExecuteToolAsync("SnapPourPoint_sa", parameters, null, cts.Token,
(eventName, o) =>
{
}, GPExecuteToolFlags.None);
if (results.IsFailed)
{
   MessageBox.Show("Failed to create fill layer. Error " + results.ErrorCode);

return;
}

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
GKmieliauskas
Esri Regular Contributor

Hi,

As I mentioned in ArcHydro tools question spatial analyst output parameter can migrate. Try specify snap distance after output raster path. In addition check validation messages sent from geoprocessing tool execute.

View solution in original post

2 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

As I mentioned in ArcHydro tools question spatial analyst output parameter can migrate. Try specify snap distance after output raster path. In addition check validation messages sent from geoprocessing tool execute.

AquanuityDevelopment
New Contributor III

Thanks a lot, @GKmieliauskas !  After I specified distance after the output raster path, it solved the problem!

0 Kudos