Good morning everyone! I would like to ask if there is a way to define my coordinates, taking into account that I don't know their coordinates system. Is there a way to determine it? All I have is an xls file. Thank you very much for your collaboration!
... View more
Hello all, We have a .dbf table of employee home addresses and work locations. Every quarter we are supposed to receive an update for this table. What I need to do is compare changes in employee home address field and work location field between the original and the update. Any suggestions on how to do this via ArcObjects? thanks In ArcObjects you can operate on a layer with a join and access the joined fields or query the joined records through the IDisplayTable interface. Some sample code (in VBA) that assumes the joined layer is the first layer in the map and already has a join in place is as follows: Public Sub GetDifferencesInJoinedRecords() Dim pMxDoc As IMxDocument Set pMxDoc = ThisDocument Dim pFLayer As IFeatureLayer Set pFLayer = pMxDoc.FocusMap.Layer(0) 'Get first layer Dim pDisplayTable As IDisplayTable Set pDisplayTable = pFLayer If Not TypeOf pDisplayTable.DisplayTable Is IRelQueryTable Then MsgBox "Feature Layer is not joined! Exiting Sub." Exit Sub End If Dim pQF as IQueryFilter Set pQF = New QueryFilter ' Add some type of SQL selection to compare your joined table. Test it first in the Select by Attributes dialog pQF.Whereclause = "ParentTableName.MyField <> JoinTableName.MyField" Dim pTableCursor As ICursor Set pTableCursor = pDisplayTable.SearchDisplayTable pQF, False Dim pRow As IRow Set pRow = pTableCursor.NextRow Dim pParentIndex As Long pParentIndex = pDisplayTable.DisplayTable.Fields.FindField("ParentTableName.myField") ' Substitute the actual Parent Table Name and Field Name If pParentIndex = -1 Then MsgBox "ParentTableName.myField Field Not Found! Exiting Sub." ' Substitute the appropriate message. Exit Sub End If Dim pJoinIndex As Long pJoinIndex = pDisplayTable.DisplayTable.Fields.FindField("JoinTableName.myField") ' Substitute the real Join Table Name and Field Name If pJoinIndex = -1 Then MsgBox "JoinTableName.myField Field Not Found! Exiting Sub." ' Fix the Message for your data Exit Sub End If Do Until pRow Is Nothing ' Keep your loop as tight as possible and do not do Dim statements inside of it. ' Do something in the loop Debug.Print pRow.Value(pParentIndex) & " <> " & pRow.Value(pJoinIndex) ' report value of field in join table Set pRow = pTableCursor.NextRow Loop Exit Sub
... View more