Select to view content in your preferred language

Call to Execute CountOverlappingFeatures Not Recognizing XY Tolerance Environment Value in C#

223
0
06-21-2023 01:05 PM
MikeSayre
Occasional Contributor

I'm trying to call CountOverlappingFeatures but it won't recognize the XYTolerance value I'm trying to pass in.  I want to use the tolerance value so that lines that are within a few meters of each other will be counted as overlapping.  When I use the geoprocessing tool independently with an XYTolerance of 15 Meters, it gives the expected results.  However, when I run it in c# with the tolerance, the tool executes, but it only counts features that are exactly overlapping, not nearby features.   What am I doing wrong?  Below is a partial code snippet.  mylist is a list of Layers.  Also, this executes within an async method.

var environment = Geoprocessing.MakeEnvironmentArray(XYTolerance: "15 Meters");

var outputfeatureclass = @"memory\OverlappingLines";

var toolparameters = Geoprocessing.MakeValueArray(mylist, outputfeatureclass);

var future = Geoprocessing.ExecuteToolAsync("CountOverlappingFeatures_analysis", toolparameters, environment, null, null, GPExecuteToolFlags.AddOutputsToMap);

 

 

0 Kudos
0 Replies