Hello ThinkGeo,
I have been trying to "tag" my features with certain objects I use for future reference. The code I do this follows. My issue is that the tag dissapears when I try to call the same sub again. Am i missing something or the use of tag is not intedned to be the one I try to use it for? Also what is the difference between TAG of a feature and TAG of a shape?
Kind Regards
Yiannis
Public Sub GetShipType()
Console.WriteLine("Here we are")
Try
aTrackLayer.FeatureSource.BeginTransaction()
Dim features = aTrackLayer.FeatureSource.GetAllFeatures(ReturningColumnsType.AllColumns)
For Each aFeature In features
Console.WriteLine(aFeature.ColumnValues("id_object"))
Dim aVessel = shipsArray.Find(AddressOf New VesselMatcher(Guid.Parse(aFeature.ColumnValues("id_object"))).Predicate)
If aVessel Is Nothing Then
aVessel = Vessel.GetVessel(Guid.Parse(aFeature.ColumnValues("id_object")), GetDBConnection())
shipsArray.Add(aVessel)
End If
Dim aTrip = aVessel.GetTripDetails(aFeature.ColumnValues("trip_id"), DateTime.Parse(aFeature.ColumnValues("first_date")), DateTime.Parse(aFeature.ColumnValues("last_date")), False, GetDBConnection())
aFeature.Tag = aTrip
aTrackLayer.FeatureSource.UpdateFeature(aFeature)
Next
aTrackLayer.FeatureSource.CommitTransaction()
features = aTrackLayer.FeatureSource.GetAllFeatures(ReturningColumnsType.AllColumns)
Console.WriteLine("Done")
Catch ex As Exception
Console.WriteLine("opps")
'aTrackLayer.EditTools.RollbackTransaction()
aTrackLayer.FeatureSource.RollbackTransaction()
End Try
End Sub