Skip to main content

IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.FileGDBWorkspaceFactory(); IFeatureWorkspace featureWorkspace1 = (IFeatureWorkspace)workspaceFactory.OpenFromFile(shapeFileName, 0); IFeatureClass featureClass1 = featureWorkspace1.OpenFeatureClass("geometryChanges");

        IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.FileGDBWorkspaceFactory();
        IFeatureWorkspace featureWorkspace1 = (IFeatureWorkspace)workspaceFactory.OpenFromFile(shapeFileName, 0);
        IFeatureClass featureClass1 = featureWorkspace1.OpenFeatureClass("geometryChanges");

        IFeatureBuffer feature = featureClass1.CreateFeatureBuffer();
        #region Catch New and compare with old ...

        ITopologicalOperator2 pTopOpNew = newFeature.ShapeCopy as ITopologicalOperator2;
        IGeometry differenceGeometry = pTopOpNew.Difference(oldFeature.Shape); 

        feature.Shape = differenceGeometry;

        UpdateFieldValuesToChanges(featureClass1, feature, uniqueId, "GAINED");
        #endregion

        #region Catch Old and compare with new ...

        IFeatureBuffer featureOld = featureClass1.CreateFeatureBuffer();
        ITopologicalOperator pTopOpOld = oldFeature.ShapeCopy as ITopologicalOperator;
        IGeometry differenceGeometryO = pTopOpOld.Difference(newFeature.Shape);
        featureOld.Shape = differenceGeometryO;
        UpdateFieldValuesToChanges(featureClass1, featureOld, uniqueId, "REDUCED");
        
        #endregion

IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.FileGDBWorkspaceFactory(); IFeatureWorkspace featureWorkspace1 = (IFeatureWorkspace)workspaceFactory.OpenFromFile(shapeFileName, 0); IFeatureClass featureClass1 = featureWorkspace1.OpenFeatureClass("geometryChanges");

        IFeatureBuffer feature = featureClass1.CreateFeatureBuffer();
        #region Catch New and compare with old ...

        ITopologicalOperator2 pTopOpNew = newFeature.ShapeCopy as ITopologicalOperator2;
        IGeometry differenceGeometry = pTopOpNew.Difference(oldFeature.Shape);
        feature.Shape = differenceGeometry;

        UpdateFieldValuesToChanges(featureClass1, feature, uniqueId, "GAINED");
        #endregion

        #region Catch Old and compare with new ...

        IFeatureBuffer featureOld = featureClass1.CreateFeatureBuffer();
        ITopologicalOperator pTopOpOld = oldFeature.ShapeCopy as ITopologicalOperator;
        IGeometry differenceGeometryO = pTopOpOld.Difference(newFeature.Shape);
        featureOld.Shape = differenceGeometryO;
        UpdateFieldValuesToChanges(featureClass1, featureOld, uniqueId, "REDUCED");
        
        #endregion
        IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.FileGDBWorkspaceFactory();
        IFeatureWorkspace featureWorkspace1 = (IFeatureWorkspace)workspaceFactory.OpenFromFile(shapeFileName, 0);
        IFeatureClass featureClass1 = featureWorkspace1.OpenFeatureClass("geometryChanges");

        IFeatureBuffer feature = featureClass1.CreateFeatureBuffer();
        #region Catch New and compare with old

        ITopologicalOperator2 pTopOpNew = newFeature.ShapeCopy as ITopologicalOperator2;
        IGeometry differenceGeometry = pTopOpNew.Difference(oldFeature.Shape); 

        feature.Shape = differenceGeometry;

        UpdateFieldValuesToChanges(featureClass1, feature, uniqueId, "GAINED");
        #endregion

        #region Catch Old and compare with new

        IFeatureBuffer featureOld = featureClass1.CreateFeatureBuffer();
        ITopologicalOperator pTopOpOld = oldFeature.ShapeCopy as ITopologicalOperator;
        IGeometry differenceGeometryO = pTopOpOld.Difference(newFeature.Shape);
        featureOld.Shape = differenceGeometryO;
        UpdateFieldValuesToChanges(featureClass1, featureOld, uniqueId, "REDUCED");
        
        #endregion
Source Link
Moe
  • 21
  • 4

IWorkspaceFactory workspaceFactory = new ESRI.ArcGIS.DataSourcesGDB.FileGDBWorkspaceFactory(); IFeatureWorkspace featureWorkspace1 = (IFeatureWorkspace)workspaceFactory.OpenFromFile(shapeFileName, 0); IFeatureClass featureClass1 = featureWorkspace1.OpenFeatureClass("geometryChanges");

        IFeatureBuffer feature = featureClass1.CreateFeatureBuffer();
        #region Catch New and compare with old ...

        ITopologicalOperator2 pTopOpNew = newFeature.ShapeCopy as ITopologicalOperator2;
        IGeometry differenceGeometry = pTopOpNew.Difference(oldFeature.Shape);
        feature.Shape = differenceGeometry;

        UpdateFieldValuesToChanges(featureClass1, feature, uniqueId, "GAINED");
        #endregion

        #region Catch Old and compare with new ...

        IFeatureBuffer featureOld = featureClass1.CreateFeatureBuffer();
        ITopologicalOperator pTopOpOld = oldFeature.ShapeCopy as ITopologicalOperator;
        IGeometry differenceGeometryO = pTopOpOld.Difference(newFeature.Shape);
        featureOld.Shape = differenceGeometryO;
        UpdateFieldValuesToChanges(featureClass1, featureOld, uniqueId, "REDUCED");
        
        #endregion