4

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.

1 Answer 1

1

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.

UPDATE: Esri has introduced the DDL(Data Definition Language) API for creating feature classes, fields, and so on. The DDL concept for pro is available here. ProConcepts DDL

1
  • 1
    As a corollary for your answer here, I would add that Esri has begun, with ArcGIS Pro 2.7, to roll out a DDL (Data Definition Language) API that can be used to create feature classes, fields, and so on. At 2.7 it's in pre-release, but hopefully it gets full release quickly after that. Some concepts and snippets are available here: link
    – Turbo
    Commented Feb 12, 2021 at 20:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.