/// <summary> /// Truncates and appends input feature class /// </summary> /// <param name="originFC">Origin feature class</param> /// <param name="originWS">origin workspace</param> /// <param name="targetFC">destination feature class</param> /// <param name="targetWS">destination workspace</param> private void TruncateAppendFeatureClass(object originFC, string originWS, object targetFC, string targetWS) { IFeatureClass truncFC; IGPProcess truncateGP = FireGeoprocessingTools.GetTruncateFeatureTableGP(targetFC); RunGeoprocess(ref truncateGP, targetWS, true, 0, out truncFC); IGPProcess appendGP = FireGeoprocessingTools.GetAppendFeatureTableGP(originFC, targetFC); RunGeoprocess(ref appendGP, targetWS); }
/// <summary> /// Copies feature class or dataset to SDE Workspace /// </summary> /// <param name="originDataName">name of origin dataset to be copied</param> /// <param name="originWS">name of origin workspace</param> /// <param name="destinationName">output target to copy</param> /// <param name="destinationPath">name of target workspace to copy to</param> public void CopyToSDEWorkspace(string originDataName, string originWS, string destinationName, string destinationPath, bool deleteExisting) { RaiseLogEvent($"Copying {originDataName}"); if (deleteExisting) { RaiseLogEvent($"Deleting {originDataName}"); IGPProcess deleteGP = FireGeoprocessingTools.GetDeleteFeatureClassGP(destinationName); RunGeoprocess(ref deleteGP, destinationPath); } else { IGPProcess renameGP = FireGeoprocessingTools.GetRenameGP(destinationName, destinationName + "_OLD"); RunGeoprocess(ref renameGP, destinationPath); } IGPProcess copyGP = FireGeoprocessingTools.GetCopyDataGP($"{originWS}\\{originDataName}", $"{destinationName}"); RunGeoprocess(ref copyGP, destinationPath, true); }