常见问题
即使 MakeEnvironmentArray 方法不支持 baDataSource 环境变量,也可以将其传递给 ExecuteToolAsync。 为此,只需创建一个键-值对列表,例如:
protected override void OnClick() { var parameters = Geoprocessing.MakeValueArray("populationtotals.totpop_cy", "2019 Total Population Layer Local", "NATURAL_BREAKS", "5"); var env = new List>() { new KeyValuePair("baDataSource", "LOCAL;;USA_ESRI_2019") }; var gp_result = Geoprocessing.ExecuteToolAsync("ba.ColorCodedLayer", parameters, env, flags:GPExecuteToolFlags.AddToHistory | GPExecuteToolFlags.AddOutputsToMap); parameters = Geoprocessing.MakeValueArray("populationtotals.totpop_cy", "2019 Total Population Layer Online", "NATURAL_BREAKS", "5"); env = new List>() { new KeyValuePair("baDataSource", "ONLINE;US;") }; gp_result = Geoprocessing.ExecuteToolAsync("ba.ColorCodedLayer", parameters, env, flags: GPExecuteToolFlags.AddToHistory | GPExecuteToolFlags.AddOutputsToMap);
获取来自 ArcGIS 专家的帮助
下载 Esri 支持应用程序