TransWikia.com

With in Version Difference (DifferenceTypeUpdateNoChange) how to pass IQueryFilter in ArcObjects

Geographic Information Systems Asked on July 22, 2021

I want to know only real shape edits between 2 versions. How can I pass iQueryfilter to DifferenceTypeUpdateNoChange?

public void DifferenceTypeUpdateNoChange(ITable sourceTable, ITable differenceTable, esriDifferenceType differenceType, iQueryfilter Qf)
        {
            IQueryFilter qf = new QueryFilterClass();
            qf.SubFields = "SHAPE.AREA,SHAPE.LEN";
            qf.WhereClause = "SHAPE.AREA,SHAPE.LEN";    
            try
            {
                IVersionedTable versionedTable = (IVersionedTable)sourceTable;
                IDifferenceCursor differenceCursor = versionedTable.Differences(differenceTable, differenceType, Qf);
                IRow differenceRow;
                int objectID;
                differenceCursor.Next(out objectID, out differenceRow);
                //Detect and output all the differences between the two versions
                int count = 0;
                while (objectID != -1)
                {                    
                    Console.WriteLine(FClassName + "," + objectID + "," + " has been modified");
                    //WriteCSV(FClassName, objectID, "Updated Feature");
                    differenceCursor.Next(out objectID, out differenceRow);                   
                    count++;
                }                
                //sw.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }

One Answer

If the objective is to detect all changes (inserts, updates and deletes) for a version based upon a query filter, then the target versioned table should be opened from the common ancestor version using IVersion2::GetCommonAncestor. The common ancestor version is the representation of the table when the source version was first created or last reconciled with the target version. This will ensure the results are all the rows which meet the definition of the query filter

You can see sample for GetCommonAncestor on : https://desktop.arcgis.com/en/arcobjects/latest/net/webframe.htm#72dfe883-e4d7-4925-835c-02bc513f91aa.htm

Answered by nicogis on July 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP