About calling the GP tools. Erase and symdiff in ArcGIS
Solution to the problem without generating results
□/ 文3 echo
I. Problem description:
Recently, I am working on a data check tool to check the correctness of the topological relationship of the spatial data. I use the following code to achieve the effect of the image erasure and the effect of the image difference set. It is strange that no result file is generated.
1. Erase the effect code
Erase terase = new erase ();
Terase. in_features = tinfeatures; // The layer to be erased.
Terase. erase_features = terasefeatures; // erase the Layer
Terase. out_feature_class = strfilename; // output file path
Terase. cluster_tolerance = This. m_tolerance; // The tolerance value.
2. difference set effect code
Symdiff tsymdiff = new symdiff ();
Tsymdiff. in_features = tinfeatures;
Tsymdiff. update_features = tupdatefeatures;
Tsymdiff. out_feature_class = strfilename;
Tsymdiff. cluster_tolerance = "0.01"; // This. m_tolerance;
Tsymdiff. join_attributes = "all ";
Ii. Problem Analysis
Possible reasons for not generating the result file are as follows: one is that the parameter settings are incorrect. For example, if the tolerance value is a numeric text, that is, the result file cannot be generated. The second is that the element class settings are incorrect.
I carefully checked the two cases and found that the code I wrote was indeed correct, but it was really strange to come to the results from the outputs.
Iii. Problem Solving
The license authorization problem is finally found. If we set the permission lower than ArcInfo when the program starts to run, the generated results will not be obtained. If you don't believe it, you can try using ArcMAP. Therefore, we need to grant the correct permissions when initializing the license.