mody_buchbinder
临时贡献者II

你好,所有人

我们正在尝试使用新的DDL创建具有double类型字段的层

sql server中的in层字段。

看起来代码忽略了比例和精度。

尝试用GP工具(添加字段)做同样的工作。

这是一个bug,特性还是下一个版本会出现的东西?

谢谢

0荣誉
Aashis
通过 Esri贡献者
Esri贡献者

@mody_buchbinder你能给我们发一个导致这个问题的代码片段吗?我们无法重现不尊重通过DDL提供的规模和精度的场景。

Pro和SQL Server的版本信息也有助于进一步诊断。

下面的字段描述在我们的测试中成功地创建了一个具有比例和精度的双字段。

FieldDescription = new FieldDescription("TestDoubleField", FieldType.Double) {Scale = 3, Precision = 9};

aashislamsal1_0 - 1624558060157. - jpeg

0荣誉
狼
通过 亚博搜索yabovip28点com
亚博搜索yabovip28点com

谢谢你的报道。 我可以重复这个问题。我会把这个问题报告给Geodatabase团队。

0荣誉
狼
通过 亚博搜索yabovip28点com
亚博搜索yabovip28点com

我承认错误。Geodatabase团队指出了我的测试外接程序中的一个错误,我选择了一个比精度更大的刻度。一旦我修复了这个错误,我得到了正确的结果:

wolf_0 - 1624571868016. - png

我使用下面的代码片段来创建特性类。'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);ArcGIS.Core.Data.DDL. var stringFieldDescription = newFieldDescription(“TheString”,FieldType.String);var intFieldDescription = new ArcGIS.Core.Data.DDL. varFieldDescription(“TheInteger”,FieldType.Integer);var dblFieldDescription = new ArcGIS.Core.Data.DDL. varFieldDescription("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() { 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}"); } }

0荣誉
dkuida
通过
新贡献者II

你好@Wolf

下面是代码,请注意该数据库是内存数据库。

然而结果是:

private async Task CreateParcelTempLayers(多边形parcelGeometry, bool shouldGeneralize) {var memoryConnectionProperties = new memoryConnectionProperties ();var map = MapView.Active.Map;使用var geodatabase = schemabubuilder . creategeodatabase (memoryConnectionProperties);BuildEdgesLayer(地图,geodatabase);} //和bellow私有void BuildEdgesLayer(Map Map, Geodatabase Geodatabase) {var shapeDescription = new shapeDescription (GeometryType。多段线,map.SpatialReference);var FieldDescription = new[] {new FieldDescription(m_FromVertexToVertex, FieldType.String){Length = 50}, new FieldDescription(m_EdgeLength, FieldType.Double) {Scale = 2, Precision = 9, AliasName = ReportsManagerResources. varReportsManagerProxy_BuildEdgesLayer_DistancesAlias},};var featureClassDescription = new featureClassDescription (m_ParcelEdgesLayerName, fielddescriptionshapedescription);var schemaBuilder = new schemaBuilder (geodatabase);schemaBuilder.Create (featureClassDescription);var success = schembuilder . build (); }

image.png

想听听你的反馈吗

0荣誉
狼
通过 亚博搜索yabovip28点com
亚博搜索yabovip28点com

感谢您的报告,一位ArcGIS Pro Geodatabase团队成员在使用内存Geodatabase时也遇到了同样的问题。这个问题将在即将发布的Pro版本中修复。