Geographic Information Systems Asked on June 3, 2021
I need to create a new Geodatabase and creating FeatureClass, Table in the Geodatabase. After that adding fields in FeatureClass and Table are also needed.
I have created a new Geodatabase using this code:
private async Task<bool> ExecuteAddFileGDB(string fileGdbPath, string fileGdbName)
{
try
{
return await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
var fGdbPath = fileGdbPath;
var fGdbName = fileGdbName;
var fGdbVersion = "Current";
var parameters = Geoprocessing.MakeValueArray
(fGdbPath, fGdbName, fGdbVersion);
var cts = new CancellationTokenSource();
var results = Geoprocessing.ExecuteToolAsync("management.CreateFileGDB", parameters, null, cts.Token,
(eventName, o) =>
{
System.Diagnostics.Debug.WriteLine($@"GP event: {eventName}");
});
return true;
});
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
return false;
}
}
I have also code developed for creating FeatureClass, Table, and for adding Fields using Geoprocessing Tools.
As my ArcObjects experience, I think a geoprocessing operation is comparatively costly than an API call. So I am seeking a way to create a new geodatabase using ArcGIS Pro API instead of the Geoprocessing tool.
Like ArcObject API http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//0001000004t8000000.
As well as for creating FeatureClass, Table, and for adding Fields.
After searching for some time, I found that It is not possible what I am looking for.
The ArcGIS.Core.Data API is a DML-only (Data Manipulation Language) API. This means that all schema creation and modification operations such as creating tables and feature classes, creating and modifying fields, enabling attachments, and so on, need to be performed using the Geoprocessing API.
Correct answer by osman on June 3, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP