I'm creating a new feature using a dictionary of attributes. However, the subtype doesn't appear to be getting set. Am I doing this correctly?
// LOAD ATTRIBUTES
appData.markUpAttributes.updateValue(1, forKey: "SubtypeCode")
let servicePointNumber = appData.targetFeature.attributes["gs_service_number"] as? String ?? ""
appData.markUpAttributes.updateValue("Move SP#\(servicePointNumber) to here.", forKey: "Comment")
appData.markUpAttributes.updateValue(Date(), forKey: "DateDrawn")
// ADD LINE
appData.polylineBuilder.add(appData.targetFeature!.geometry as! Point)
appData.polylineBuilder.add(mapPoint)
let line = appData.polylineBuilder.toGeometry()
let lineFeature = appData.mapLineTable.makeFeature(attributes: appData.markUpAttributes as [String : Any], geometry: line)
try await self.AddFeatureToMapLineTable(newFeature: lineFeature)
Solved! Go to Solution.
What is the exact field type for `SubtypeCode`? For example, is it int32 or int64?
If it is int32, you might need to do this:
appData.markUpAttributes.updateValue(Int32(1), forKey: "SubtypeCode")
And if it is int64, this:
appData.markUpAttributes.updateValue(Int64(1), forKey: "SubtypeCode")
The literal value of `1` in Swift is an `Int` in your code. Because features are strongly typed, we need to make sure we are passing the exact integer type to attributes.
What is the exact field type for `SubtypeCode`? For example, is it int32 or int64?
If it is int32, you might need to do this:
appData.markUpAttributes.updateValue(Int32(1), forKey: "SubtypeCode")
And if it is int64, this:
appData.markUpAttributes.updateValue(Int64(1), forKey: "SubtypeCode")
The literal value of `1` in Swift is an `Int` in your code. Because features are strongly typed, we need to make sure we are passing the exact integer type to attributes.
Needed to add Int32(1). Thanks