Hello all
我们正在尝试使用新的DDL
字段in 层在SQL server。
看起来代码忽略了比例和精度。
试图用GP工具(添加字段)做同样的工作。
这是一个bug,功能还是下一个版本会出现的东西?< / P > < P > < / P >感谢
嗨@mody_buchbinder ,你能给我们一个导致这个问题的代码片段吗?我们无法重现不尊重通过DDL提供的规模和精度的场景。
Pro和SQL Server的版本信息也有助于进一步诊断。
下面的字段描述在我们的测试中成功创建了一个具有规模和精度的双字段
我更正。 Geodatabase团队指出了我的测试插件中的一个错误,我选择了一个比精度更大的刻度。一旦我修复了这个错误,我就得到了正确的结果:
我使用下面的代码片段来创建功能类。 'selectedFeatureLayer'是我从TOC获得的功能层,以便获得我的数据库连接。
var selectedLayerTable = selectedFeatureLayer.GetTable();var testName = $@"Point{DateTime.Now:HHmmss}";var hasZ = false;var hasM = false;//创建ShapeDescription对象var ShapeDescription = new ShapeDescription(点,SpatialReferences.WebMercator) {HasM = HasM, HasZ = HasZ};var objecdfielddescription = new ArcGIS.Core.Data.DDL. varFieldDescription(“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<ArcGIS.Core.Data.DDL.FieldDescription>() { 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}"); } }
Hello @Wolf
下面是代码,注意数据库是内存数据库。
然而结果是:
Would love to hear your feedback
感谢您的报告,一个ArcGIS Pro Geodatabase团队成员在使用内存Geodatabase时能够重复这个问题。这个问题将在即将发布的Pro版本中修复