<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Create a double field using the DDL in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-double-field-using-the-ddl/m-p/1072351#M6802</link>
    <description>&lt;P&gt;I stand corrected.&amp;nbsp; The Geodatabase team pointed out the error in my test add-in where I chose a scale larger than the precision.&amp;nbsp; Once I fixed that error I get the proper result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_0-1624571868016.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/16936iB04935A7E3814463/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_0-1624571868016.png" alt="Wolf_0-1624571868016.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the following code snippet to create the feature class.&amp;nbsp; The 'selectedFeatureLayer' is a feature layer I get from the TOC in order to get my database connection.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var selectedLayerTable = selectedFeatureLayer.GetTable();

var testName = $@"Point{DateTime.Now:HHmmss}";
var hasZ = false;
var hasM = false;
// Create a ShapeDescription object
var shapeDescription = new ShapeDescription(GeometryType.Point, SpatialReferences.WebMercator)
{
	HasM = hasM,
	HasZ = hasZ
};
var objectIDFieldDescription = new ArcGIS.Core.Data.DDL.FieldDescription("ObjectID", FieldType.OID);
var stringFieldDescription = new ArcGIS.Core.Data.DDL.FieldDescription("TheString", FieldType.String);
var intFieldDescription = new ArcGIS.Core.Data.DDL.FieldDescription("TheInteger", FieldType.Integer);
var dblFieldDescription = new ArcGIS.Core.Data.DDL.FieldDescription("TheDouble", FieldType.Double)
{
	Precision = 9,
	Scale = 5
};
var dateFieldDescription = new ArcGIS.Core.Data.DDL.FieldDescription("TheDate", FieldType.Date);

using (var geoDb = selectedLayerTable.GetDatastore() as Geodatabase)
{
	var fcName = $@"{testName}";
	try
	{
		// Assemble a list of all of our field descriptions
		var fieldDescriptions = new List&amp;lt;ArcGIS.Core.Data.DDL.FieldDescription&amp;gt;() {
						objectIDFieldDescription,
						stringFieldDescription,
						intFieldDescription,
						dblFieldDescription,
						dateFieldDescription
					};
		// Create a FeatureClassDescription object to describe the feature class to create
		var fcDescription =
			new FeatureClassDescription(fcName, fieldDescriptions, shapeDescription);

		// Create a SchemaBuilder object
		SchemaBuilder schemaBuilder = new SchemaBuilder(geoDb);

		// Add the creation of the Cities feature class to our list of DDL tasks
		schemaBuilder.Create(fcDescription);

		// Execute the DDL
		bool success = schemaBuilder.Build();
	}
	catch (Exception ex)
	{
		MessageBox.Show($@"Exception: {ex}");
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Jun 2021 22:01:06 GMT</pubDate>
    <dc:creator>Wolf</dc:creator>
    <dc:date>2021-06-24T22:01:06Z</dc:date>
    <item>
      <title>Create a double field using the DDL</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-double-field-using-the-ddl/m-p/1071947#M6793</link>
      <description>&lt;P&gt;Hello all&lt;/P&gt;&lt;P&gt;We are trying to create layer with field with type double using the new DDL&lt;/P&gt;&lt;P&gt;The field in in&amp;nbsp; layer in sql server.&lt;/P&gt;&lt;P&gt;It looks like the code ignore the scale and precision.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Trying to do the same with GP tool (Add Field) works.&lt;/P&gt;&lt;P&gt;Is this a bug, feature or something that will come in the next version?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 12:32:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-double-field-using-the-ddl/m-p/1071947#M6793</guid>
      <dc:creator>mody_buchbinder</dc:creator>
      <dc:date>2021-06-24T12:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create a double field using the DDL</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-double-field-using-the-ddl/m-p/1072194#M6797</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/413050"&gt;@mody_buchbinder&lt;/a&gt;&amp;nbsp;, Could you please send us a code snippet that causing the issue? We are not able to reproduce the scenario that doesn't honor the scale and precision provided through DDL.&lt;/P&gt;&lt;P&gt;Version info of Pro and SQL Server are also helpful for further diagnosis.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The following field description successfully created a double field with scale and precision in our test.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FieldDescription doubleFieldDescription = new FieldDescription("TestDoubleField", FieldType.Double) { Scale = 3, Precision = 9 };&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="AashisLamsal1_0-1624558060157.jpeg" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/16897iFDF6388A3EAD24A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="AashisLamsal1_0-1624558060157.jpeg" alt="AashisLamsal1_0-1624558060157.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 19:28:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-double-field-using-the-ddl/m-p/1072194#M6797</guid>
      <dc:creator>Aashis</dc:creator>
      <dc:date>2021-06-24T19:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: Create a double field using the DDL</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-double-field-using-the-ddl/m-p/1072260#M6800</link>
      <description>&lt;P&gt;Thanks for reporting this.&amp;nbsp; &lt;STRIKE&gt;I was able to duplicate this problem.&amp;nbsp;&lt;/STRIKE&gt; &amp;nbsp;I will report the issue to the Geodatabase team.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 22:01:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-double-field-using-the-ddl/m-p/1072260#M6800</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2021-06-24T22:01:48Z</dc:date>
    </item>
    <item>
      <title>Re: Create a double field using the DDL</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-double-field-using-the-ddl/m-p/1072351#M6802</link>
      <description>&lt;P&gt;I stand corrected.&amp;nbsp; The Geodatabase team pointed out the error in my test add-in where I chose a scale larger than the precision.&amp;nbsp; Once I fixed that error I get the proper result:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Wolf_0-1624571868016.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/16936iB04935A7E3814463/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Wolf_0-1624571868016.png" alt="Wolf_0-1624571868016.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the following code snippet to create the feature class.&amp;nbsp; The 'selectedFeatureLayer' is a feature layer I get from the TOC in order to get my database connection.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var selectedLayerTable = selectedFeatureLayer.GetTable();

var testName = $@"Point{DateTime.Now:HHmmss}";
var hasZ = false;
var hasM = false;
// Create a ShapeDescription object
var shapeDescription = new ShapeDescription(GeometryType.Point, SpatialReferences.WebMercator)
{
	HasM = hasM,
	HasZ = hasZ
};
var objectIDFieldDescription = new ArcGIS.Core.Data.DDL.FieldDescription("ObjectID", FieldType.OID);
var stringFieldDescription = new ArcGIS.Core.Data.DDL.FieldDescription("TheString", FieldType.String);
var intFieldDescription = new ArcGIS.Core.Data.DDL.FieldDescription("TheInteger", FieldType.Integer);
var dblFieldDescription = new ArcGIS.Core.Data.DDL.FieldDescription("TheDouble", FieldType.Double)
{
	Precision = 9,
	Scale = 5
};
var dateFieldDescription = new ArcGIS.Core.Data.DDL.FieldDescription("TheDate", FieldType.Date);

using (var geoDb = selectedLayerTable.GetDatastore() as Geodatabase)
{
	var fcName = $@"{testName}";
	try
	{
		// Assemble a list of all of our field descriptions
		var fieldDescriptions = new List&amp;lt;ArcGIS.Core.Data.DDL.FieldDescription&amp;gt;() {
						objectIDFieldDescription,
						stringFieldDescription,
						intFieldDescription,
						dblFieldDescription,
						dateFieldDescription
					};
		// Create a FeatureClassDescription object to describe the feature class to create
		var fcDescription =
			new FeatureClassDescription(fcName, fieldDescriptions, shapeDescription);

		// Create a SchemaBuilder object
		SchemaBuilder schemaBuilder = new SchemaBuilder(geoDb);

		// Add the creation of the Cities feature class to our list of DDL tasks
		schemaBuilder.Create(fcDescription);

		// Execute the DDL
		bool success = schemaBuilder.Build();
	}
	catch (Exception ex)
	{
		MessageBox.Show($@"Exception: {ex}");
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 22:01:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-double-field-using-the-ddl/m-p/1072351#M6802</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2021-06-24T22:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Create a double field using the DDL</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-double-field-using-the-ddl/m-p/1073112#M6808</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/12882"&gt;@Wolf&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code, note that the database is a memory database.&lt;/P&gt;&lt;P&gt;And yet the result is:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;   private async Task CreateParcelTempLayers(Polygon parcelGeometry, bool shouldGeneralize)
        {
            
            var memoryConnectionProperties = new MemoryConnectionProperties();
            var map = MapView.Active.Map;
           

            using var geodatabase = SchemaBuilder.CreateGeodatabase(memoryConnectionProperties);

            

            BuildEdgesLayer(map, geodatabase);
            
        }

// and bellow

private void BuildEdgesLayer(Map map, Geodatabase geodatabase)
        {
            var shapeDescription = new ShapeDescription(GeometryType.Polyline, map.SpatialReference);
            var fieldDescriptions = new[]
            {
                new FieldDescription(m_FromVertexToVertex, FieldType.String){Length = 50},
                
                new FieldDescription(m_EdgeLength, FieldType.Double)
                {
                    Scale = 2,
                    Precision = 9,
                    
                    AliasName = ReportsManagerResources.ReportsManagerProxy_BuildEdgesLayer_DistancesAlias
                },
            };
            var featureClassDescription =
                new FeatureClassDescription(m_ParcelEdgesLayerName, fieldDescriptions, shapeDescription);

            var schemaBuilder = new SchemaBuilder(geodatabase);

            schemaBuilder.Create(featureClassDescription);

            var success = schemaBuilder.Build();
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/17148iC43972915C7463DF/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would love to hear your feedback&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 08:41:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-double-field-using-the-ddl/m-p/1073112#M6808</guid>
      <dc:creator>dkuida</dc:creator>
      <dc:date>2021-06-28T08:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create a double field using the DDL</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-double-field-using-the-ddl/m-p/1073236#M6810</link>
      <description>&lt;P&gt;Thanks for reporting this, an ArcGIS Pro Geodatabase team member was able to duplicate this problem when using a memory Geodatabase.&amp;nbsp; The issue will be fixed in an upcoming Pro release.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Jun 2021 15:51:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/create-a-double-field-using-the-ddl/m-p/1073236#M6810</guid>
      <dc:creator>Wolf</dc:creator>
      <dc:date>2021-06-28T15:51:55Z</dc:date>
    </item>
  </channel>
</rss>

