public ViewColumnItem(FeatureSourceColumn column, string alias, bool isCalculated = false)
        {
            this.column       = column;
            this.id           = Guid.NewGuid().ToString();
            this.columnName   = column.ColumnName;
            this.columnType   = column.TypeName;
            this.columnLength = column.MaxLength;
            this.aliasName    = alias;
            viewVisibility    = Visibility.Visible;
            renameVisibility  = Visibility.Collapsed;

            if (isCalculated)
            {
                contextMenu = new ContextMenu();

                MenuItem editItem = new MenuItem();
                editItem.Click += EditItem_Click;
                editItem.Header = "Edit";

                MenuItem deleteItem = new MenuItem();
                deleteItem.Click += DeleteItem_Click;
                deleteItem.Header = "Delete";

                contextMenu.Items.Add(editItem);
                contextMenu.Items.Add(deleteItem);
            }
        }
 public FeatureSourceColumnDefinition(FeatureSourceColumn featureSourceColumn, FeatureLayer featureLayer)
 {
     this.isDuplicate         = false;
     this.featureSourceColumn = featureSourceColumn;
     this.originalName        = featureSourceColumn.ColumnName;
     this.columnName          = featureSourceColumn.ColumnName;
     this.featureLayer        = featureLayer;
     this.layerName           = featureLayer.Name;
 }
Esempio n. 3
0
        private static void AddRow(FeatureSourceColumn featureSourceColumn, DataTable dataTable)
        {
            DataRow dataRow = dataTable.NewRow();

            dataRow[0] = featureSourceColumn.ColumnName;
            dataRow[1] = featureSourceColumn.MaxLength;
            dataRow[2] = featureSourceColumn.TypeName;

            dataTable.Rows.Add(dataRow);
        }
Esempio n. 4
0
        protected override void EnterCore(DissolveWizardShareObject parameter)
        {
            base.EnterCore(parameter);
            if (Parent.MoveDirection == MoveDirection.Next)
            {
                dataContext         = new ChooseDataViewModel(parameter.SelectedFeatureLayer, parameter.DissolveSelectedFeaturesOnly);
                content             = new ChooseDataUserControl();
                content.DataContext = dataContext;
                Content             = content;

                dataContext.ExtraColumns.Clear();

                if (parameter.ExtraColumns.Count == 0)
                {
                    if (Parent.MoveDirection == MoveDirection.Next)
                    {
                        Parent.MoveNext();
                    }
                    else
                    {
                        Parent.MoveBack();
                    }
                }
                else
                {
                    FeatureSourceColumn addAllStringColumn = new FeatureSourceColumn(ChooseDataViewModel.AddAllString);
                    dataContext.ExtraColumns.Add(new CheckableItemViewModel <FeatureSourceColumn>(addAllStringColumn));

                    Collection <FeatureSourceColumn> featureSourceColumns = new Collection <FeatureSourceColumn>();
                    lock (parameter.SelectedFeatureLayer)
                    {
                        if (!parameter.SelectedFeatureLayer.IsOpen)
                        {
                            parameter.SelectedFeatureLayer.Open();
                        }
                        featureSourceColumns = parameter.SelectedFeatureLayer.QueryTools.GetColumns();
                    }

                    foreach (var extraColumn in parameter.ExtraColumns)
                    {
                        FeatureSourceColumn extraFeatureSourceColumn = featureSourceColumns.FirstOrDefault(tmpColumn => tmpColumn.ColumnName.Equals(extraColumn, StringComparison.Ordinal));
                        var column = new CheckableItemViewModel <FeatureSourceColumn>(extraFeatureSourceColumn);
                        column.AliasName = parameter.SelectedFeatureLayer.FeatureSource.GetColumnAlias(extraFeatureSourceColumn.ColumnName);
                        dataContext.ExtraColumns.Add(column);
                    }

                    dataContext.SelectedColumn   = dataContext.ExtraColumns[0];
                    dataContext.SelectedOperator = DissolveOperatorMode.First;
                }
            }
        }
        private void InitializeHightlightFeatureLayer()
        {
            this.highlightFeatureLayer = new InMemoryFeatureLayer(); // { MaxRecordsToDraw = 5000 };

            GeoSolidBrush fillColor   = new GeoSolidBrush(GeoColor.StandardColors.Transparent);
            GeoSolidBrush outerColor  = new GeoSolidBrush(new GeoColor(255, GeoColor.SimpleColors.Yellow));
            GeoSolidBrush innerColor  = new GeoSolidBrush(new GeoColor(255, GeoColor.FromHtml("#B0EBFF")));
            GeoSolidBrush centerColor = new GeoSolidBrush(new GeoColor(0, GeoColor.FromHtml("#FFFFFF")));

            ZoomLevel zoomLevel = this.HighlightFeatureLayer.ZoomLevelSet.ZoomLevel01;

            zoomLevel.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            zoomLevel.DefaultAreaStyle.Advanced.FillCustomBrush = fillColor;
            zoomLevel.DefaultAreaStyle.OutlinePen.Brush         = outerColor;
            zoomLevel.DefaultAreaStyle.OutlinePen.Width         = 2.0f;

            zoomLevel.DefaultLineStyle.OuterPen.Brush  = outerColor;
            zoomLevel.DefaultLineStyle.OuterPen.Width  = 5.0f;
            zoomLevel.DefaultLineStyle.InnerPen.Brush  = innerColor;
            zoomLevel.DefaultLineStyle.InnerPen.Width  = 1.0f;
            zoomLevel.DefaultLineStyle.CenterPen.Brush = centerColor;
            zoomLevel.DefaultLineStyle.CenterPen.Width = 1.0f;

            zoomLevel.DefaultPointStyle.Advanced.CustomBrush = fillColor;
            zoomLevel.DefaultPointStyle.SymbolPen.Brush      = outerColor;
            zoomLevel.DefaultPointStyle.SymbolPen.Width      = 2.0f;

            zoomLevel.DefaultTextStyle.TextSolidBrush = new GeoSolidBrush(GeoColor.StandardColors.Yellow);
            zoomLevel.DefaultTextStyle.TextColumnName = FeatureIdColumnName;
            zoomLevel.DefaultTextStyle.Font           = new GeoFont("Arial", 7, DrawingFontStyles.Bold);

            highlightFeatureLayer.Open();
            var featureIdColumn = new FeatureSourceColumn(FeatureIdColumnName);

            if (!this.highlightFeatureLayer.Columns.Contains(featureIdColumn))
            {
                this.highlightFeatureLayer.Columns.Add(featureIdColumn);
                //this.highlightFeatureLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.CreateSimpleTextStyle(FeatureIdColumnName, "Arial", 7, DrawingFontStyles.Bold, GeoColor.FromArgb(255, 91, 91, 91));
            }
            highlightFeatureLayer.Close();
        }
            protected override Collection <FeatureSourceColumn> GetColumnsCore()
            {
                string          sqlStatement = string.Format("select * from {0} where 1=0;", tableName);
                OleDbCommand    command      = null;
                OleDbDataReader dataReader   = null;
                Collection <FeatureSourceColumn> columnCollection = new Collection <FeatureSourceColumn>();

                command = new OleDbCommand(sqlStatement, connection);

                dataReader = command.ExecuteReader();
                if (dataReader != null)
                {
                    dataReader.Dispose();
                }
                DataTable dataTable = new DataTable();

                dataTable.Locale = CultureInfo.InvariantCulture;
                OleDbDataAdapter adpter = new OleDbDataAdapter(command);

                adpter.Fill(dataTable);

                foreach (DataColumn column in dataTable.Columns)
                {
                    string columnName = column.ColumnName;
                    string typeName   = column.DataType.Name;
                    int    maxLength  = column.MaxLength;
                    if (columnName == wkbFieldName)
                    {
                        typeName = "geometry";
                    }
                    FeatureSourceColumn featureColumn = new FeatureSourceColumn(columnName, typeName, maxLength);
                    columnCollection.Add(featureColumn);
                }
                adpter.Dispose();
                dataTable.Dispose();

                return(columnCollection);
            }
        private void ExportToShapeFile(Collection <Feature> resultFeatures, Collection <FeatureSourceColumn> columns, FeatureLayerPlugin sourceLayerPlugin, WellKnownType type)
        {
            int count = resultFeatures.Count;

            if (count > 0)
            {
                FeatureLayerPlugin targetLayerPlugin = (FeatureLayerPlugin)GisEditor.LayerManager.GetLayerPlugins(typeof(ShapeFileFeatureLayer)).FirstOrDefault();
                FeatureLayer       resultLayer       = null;

                if (targetLayerPlugin != null)
                {
                    GetLayersParameters             getLayerParameters = new GetLayersParameters();
                    ConfigureFeatureLayerParameters parameters         = targetLayerPlugin.GetCreateFeatureLayerParameters(columns);
                    if (parameters != null && sourceLayerPlugin != null)
                    {
                        bool needColumns = false;
                        Collection <string> tempColumns = new Collection <string>();
                        if (parameters.CustomData.ContainsKey("Columns"))
                        {
                            tempColumns = parameters.CustomData["Columns"] as Collection <string>;
                        }
                        else
                        {
                            needColumns = true;
                        }

                        var featureColumns = columns.Where(c => needColumns || tempColumns.Contains(c.ColumnName));
                        if (targetLayerPlugin.CanCreateFeatureLayerWithSourceColumns(sourceLayerPlugin))
                        {
                            foreach (var item in featureColumns)
                            {
                                FeatureSourceColumn column = new FeatureSourceColumn(item.ColumnName, item.TypeName, item.MaxLength);
                                if (column.TypeName.Equals("c", StringComparison.InvariantCultureIgnoreCase))
                                {
                                    column.TypeName = "Character";
                                }
                                parameters.AddedColumns.Add(column);
                            }
                        }
                        else
                        {
                            var geoColumns = sourceLayerPlugin.GetIntermediateColumns(featureColumns);
                            foreach (var item in geoColumns)
                            {
                                if (item.TypeName.Equals("c", StringComparison.InvariantCultureIgnoreCase))
                                {
                                    item.TypeName = "Character";
                                }
                                parameters.AddedColumns.Add(item);
                            }
                        }


                        parameters.WellKnownType = type;
                        //parameters.CustomData["SourceLayer"] = featureLayer;

                        getLayerParameters.LayerUris.Add(parameters.LayerUri);
                        foreach (var item in parameters.CustomData)
                        {
                            getLayerParameters.CustomData[item.Key] = item.Value;
                        }

                        Proj4Projection proj4 = new Proj4Projection();
                        proj4.InternalProjectionParametersString = parameters.Proj4ProjectionParametersString;
                        proj4.ExternalProjectionParametersString = GisEditor.ActiveMap.DisplayProjectionParameters;
                        proj4.SyncProjectionParametersString();
                        proj4.Open();

                        foreach (var item in resultFeatures)
                        {
                            Feature feature = proj4.ConvertToInternalProjection(item);
                            parameters.AddedFeatures.Add(feature);
                        }

                        if (parameters.MemoColumnConvertMode == MemoColumnConvertMode.ToCharacter)
                        {
                            foreach (var item in parameters.AddedColumns.Where(c => c.TypeName.Equals("Memo", StringComparison.InvariantCultureIgnoreCase)).ToList())
                            {
                                item.TypeName  = "Character";
                                item.MaxLength = 254;
                                DbfColumn tmpDbfColumn = item as DbfColumn;
                                if (tmpDbfColumn != null)
                                {
                                    tmpDbfColumn.ColumnType = DbfColumnType.Character;
                                    tmpDbfColumn.Length     = 254;
                                }
                            }
                        }

                        resultLayer = targetLayerPlugin.CreateFeatureLayer(parameters);
                        resultLayer.FeatureSource.Projection = proj4;
                        resultLayer = targetLayerPlugin.GetLayers(getLayerParameters).FirstOrDefault() as FeatureLayer;
                    }
                }

                if (resultLayer != null)
                {
                    GisEditorMessageBox messageBox = new GisEditorMessageBox(MessageBoxButton.YesNo);
                    messageBox.Owner = Application.Current.MainWindow;
                    messageBox.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                    messageBox.Title        = GisEditor.LanguageManager.GetStringResource("NavigatePluginAddToMap");
                    messageBox.Message      = GisEditor.LanguageManager.GetStringResource("DoYouWantToAddToMap");
                    messageBox.ErrorMessage = string.Empty;
                    if (messageBox.ShowDialog().Value)
                    {
                        GisEditor.ActiveMap.AddLayerToActiveOverlay(resultLayer);
                        GisEditor.ActiveMap.RefreshActiveOverlay();
                        RefreshArgs refreshArgs = new RefreshArgs(this, "LoadToMapCore");
                        InvokeRefreshPlugins(GisEditor.UIManager, refreshArgs);
                        GisEditor.ActiveMap.Refresh();
                    }
                }
            }
            else
            {
                System.Windows.Forms.MessageBox.Show("There is no features to export.", "Export");
            }
        }
Esempio n. 8
0
        protected override FeatureLayer CreateFeatureLayerCore(ConfigureFeatureLayerParameters featureLayerStructureParameters)
        {
            string layerPath = LayerPluginHelper.GetLayerUriToSave(featureLayerStructureParameters.LayerUri, ExtensionFilter);
            string fileName  = Path.GetFileNameWithoutExtension(layerPath);

            if (string.IsNullOrEmpty(layerPath))
            {
                return(null);
            }
            if (fileName.FirstOrDefault() != null && Char.IsNumber(fileName.FirstOrDefault()))
            {
                MessageBox.Show("Table name can not start with number.");
                return(null);
            }
            featureLayerStructureParameters.LayerUri = new Uri(layerPath);

            Collection <FeatureSourceColumn> columns = new Collection <FeatureSourceColumn>();

            System.Text.RegularExpressions.Regex regx = new System.Text.RegularExpressions.Regex(@"\W");
            foreach (var column in featureLayerStructureParameters.AddedColumns)
            {
                FeatureSourceColumn newColumn = column;
                if (newColumn.ColumnName.Equals("Null", StringComparison.Ordinal))
                {
                    newColumn.ColumnName = "Null_";
                }
                newColumn.ColumnName = regx.Replace(newColumn.ColumnName, string.Empty);
                columns.Add(newColumn);
            }

            string tableName = string.Empty;

            if (featureLayerStructureParameters.CustomData.ContainsKey("TableName"))
            {
                //if (createFeatureLayerParameters.Tag != null)
                //tableName = createFeatureLayerParameters.Tag.ToString().Split('|').First();
                tableName = featureLayerStructureParameters.CustomData["TableName"] as string;
            }
            else
            {
                tableName = Path.GetFileNameWithoutExtension(featureLayerStructureParameters.LayerUri.OriginalString);
            }

            FileGeoDatabaseFeatureLayer.CreateFileGeoDatabase(featureLayerStructureParameters.LayerUri.OriginalString);
            FileGeoDatabaseFeatureLayer.CreateTable(featureLayerStructureParameters.LayerUri.OriginalString, tableName, featureLayerStructureParameters.WellKnownType, columns);

            string prjPath = Path.ChangeExtension(featureLayerStructureParameters.LayerUri.OriginalString, "prj");

            File.WriteAllText(prjPath, Proj4Projection.ConvertProj4ToPrj(featureLayerStructureParameters.Proj4ProjectionParametersString));

            FileGeoDatabaseFeatureLayer fileGeoDatabaseFeatureLayer = new FileGeoDatabaseFeatureLayer(featureLayerStructureParameters.LayerUri.LocalPath, tableName);

            if (featureLayerStructureParameters.AddedFeatures.Count > 0)
            {
                fileGeoDatabaseFeatureLayer.Open();
                fileGeoDatabaseFeatureLayer.EditTools.BeginTransaction();
                foreach (var feature in featureLayerStructureParameters.AddedFeatures)
                {
                    fileGeoDatabaseFeatureLayer.EditTools.Add(feature);
                }
                fileGeoDatabaseFeatureLayer.EditTools.CommitTransaction();
                fileGeoDatabaseFeatureLayer.Close();
            }

            return(fileGeoDatabaseFeatureLayer);
        }
Esempio n. 9
0
 public ColumnModel(FeatureLayer ownerLayer, FeatureSourceColumn column)
     : base()
 {
     this.OwnerLayer = ownerLayer;
     this.Column     = column;
 }
        protected override void RunCore()
        {
            //if (FeatureLayer != null && FeatureLayer.FeatureSource.LinkSources.Count > 0)
            //{
            //    hasLinkSource = true;
            //}

            if (FeaturesForExporting.Count == 0 && FeatureIdsForExporting.Count > 0 && FeatureLayer != null)
            {
                FeatureLayer.CloseAll();
                FeatureLayer.SafeProcess(() =>
                {
                    //if (FeatureLayer.FeatureSource.LinkSources.Count > 0)
                    //{
                    //    featuresForExporting = FeatureLayer.FeatureSource.GetFeaturesByIds(FeatureIdsForExporting, FeatureLayer.GetDistinctColumnNames());
                    //    hasLinkSource = true;
                    //}
                    //else
                    //{
                    //    featuresForExporting = FeatureLayer.QueryTools.GetFeaturesByIds(FeatureIdsForExporting, FeatureLayer.GetDistinctColumnNames());
                    //    hasLinkSource = false;
                    //}

                    featuresForExporting = FeatureLayer.QueryTools.GetFeaturesByIds(FeatureIdsForExporting, FeatureLayer.GetDistinctColumnNames());
                    hasLinkSource        = false;
                });
            }

            Proj4Projection proj4 = new Proj4Projection();

            proj4.InternalProjectionParametersString = InternalPrj4Projection;
            proj4.ExternalProjectionParametersString = Proj4Projection.ConvertPrjToProj4(ProjectionWkt);
            proj4.SyncProjectionParametersString();
            proj4.Open();

            Collection <Feature> exportFeatures = FeaturesForExporting;

            if (proj4.CanProject())
            {
                exportFeatures = new Collection <Feature>();
                foreach (var item in FeaturesForExporting)
                {
                    Feature newFeature = item;
                    newFeature = proj4.ConvertToExternalProjection(item);
                    exportFeatures.Add(newFeature);
                }
            }
            proj4.Close();

            #region This is a trick to fix that fox pro columns cannot write to dbf, convert all fox pro columns to character column type.

            if (hasLinkSource)
            {
                Collection <string> dateTimeColumns = new Collection <string>();
                Collection <string> dateColumns     = new Collection <string>();

                foreach (var item in FeatureSourceColumns)
                {
                    string doubleInBinary  = DbfColumnType.DoubleInBinary.ToString();
                    string integerInBinary = DbfColumnType.IntegerInBinary.ToString();
                    string dateTime        = DbfColumnType.DateTime.ToString();
                    string date            = DbfColumnType.Date.ToString();
                    string logical         = DbfColumnType.Logical.ToString();

                    if (item.TypeName.Equals(doubleInBinary, StringComparison.OrdinalIgnoreCase) ||
                        item.TypeName.Equals(integerInBinary, StringComparison.OrdinalIgnoreCase) ||
                        item.TypeName.Equals(dateTime, StringComparison.OrdinalIgnoreCase) ||
                        item.TypeName.Equals(date, StringComparison.OrdinalIgnoreCase) ||
                        item.TypeName.Equals(logical, StringComparison.OrdinalIgnoreCase))
                    {
                        item.TypeName = DbfColumnType.Character.ToString();
                    }
                }

                Dictionary <string, int> longLengthColumnNames = new Dictionary <string, int>();

                //foreach (var feature in exportFeatures)
                //{
                //    // Fill link column values into column values.
                //    foreach (var item in feature.LinkColumnValues)
                //    {
                //        string key = item.Key;
                //        string value = string.Join("\r\n", item.Value.Select(v => v.Value));
                //        feature.ColumnValues[key] = value;
                //        longLengthColumnNames[key] = value.Length;
                //    }
                //}

                // fix too long column value
                foreach (var key in longLengthColumnNames.Keys)
                {
                    FeatureSourceColumn column = FeatureSourceColumns.FirstOrDefault(f => f.ColumnName.Equals(key, StringComparison.OrdinalIgnoreCase));
                    if (column != null)
                    {
                        int length = longLengthColumnNames[key];
                        if (length > column.MaxLength)
                        {
                            column.MaxLength = length;
                        }
                    }
                }
            }

            #endregion This is a trick to fix that fox pro columns cannot write to dbf.

            if (NeedConvertMemoToCharacter)
            {
                foreach (var feature in exportFeatures)
                {
                    foreach (var item in FeatureSourceColumns)
                    {
                        if (item.TypeName.Equals(DbfColumnType.Memo.ToString(), StringComparison.OrdinalIgnoreCase))
                        {
                            item.TypeName  = DbfColumnType.Character.ToString();
                            item.MaxLength = 254;
                        }
                        else if (item.TypeName.Equals(DbfColumnType.Character.ToString(), StringComparison.OrdinalIgnoreCase) &&
                                 item.MaxLength > 254)
                        {
                            item.MaxLength = 254;
                        }
                        //if (feature.ColumnValues.ContainsKey(item.ColumnName) && feature.ColumnValues[item.ColumnName].Length > 254)
                        //{
                        //    feature.ColumnValues[item.ColumnName] = feature.ColumnValues[item.ColumnName].Substring(0, 254);
                        //}
                    }
                }
            }

            var info = new FileExportInfo(exportFeatures, FeatureSourceColumns, OutputPathFileName, ProjectionWkt);
            foreach (var item in CostomizedColumnNames)
            {
                info.CostomizedColumnNames.Add(item.Key, item.Value);
            }
            Export(info);
        }
        //private IEnumerable<string> GetMatchColumnsFromString(string matchColumnsInString)
        //{
        //    string[] columns = matchColumnsInString.Split(',');
        //    return columns;
        //}

        private void Dissolve()
        {
            Collection <Feature> dissolvedFeatures = new Collection <Feature>();

            // get features to dissolve.
            Collection <Feature> featuresToDissolve = GetFeaturesToDissolve();

            // group features.
            var featureGroupByShapeType = featuresToDissolve.GroupBy(f =>
            {
                return(f.GetShape().GetType());
            });

            // collect export columns.
            var filteredFeatureColumns = new Collection <FeatureSourceColumn>();

            foreach (var matchColumn in this.matchColumns)
            {
                var tmpColumn = featureColumns.FirstOrDefault(f => f.ColumnName.Equals(matchColumn, StringComparison.Ordinal));
                if (tmpColumn != null)
                {
                    filteredFeatureColumns.Add(tmpColumn);
                }
            }

            foreach (var extraColumn in this.operatorPairs)
            {
                var tmpColumn = featureColumns.FirstOrDefault(f => f.ColumnName.Equals(extraColumn.ColumnName, StringComparison.Ordinal));
                if (tmpColumn != null)
                {
                    filteredFeatureColumns.Add(tmpColumn);
                }
            }

            filteredFeatureColumns.Add(new FeatureSourceColumn("Count", "Integer", 8));

            Action <IGrouping <Type, Feature>, Action <IEnumerable <Feature>, Dictionary <string, string> > > dissolveAction
                = new Action <IGrouping <Type, Feature>, Action <IEnumerable <Feature>, Dictionary <string, string> > >
                      ((groupByType, finalProcessAction) =>
            {
                //CancelTask(this.CancellationSource.Token, content, parameter);
                var groupByColumns = GroupByColumns(groupByType, this.matchColumns);
                groupByColumns.ForEach(groupFeature =>
                {
                    //CancelTask(this.CancellationSource.Token, content, parameter);
                    Dictionary <string, string> newColumnValues = new Dictionary <string, string>();
                    foreach (var tmpMatchColumn in this.matchColumns)
                    {
                        newColumnValues.Add(tmpMatchColumn, groupFeature.First().ColumnValues[tmpMatchColumn]);
                    }

                    foreach (var operatorPair in this.operatorPairs)
                    {
                        //CancelTask(this.CancellationSource.Token, content, parameter);
                        CollectNewColumnValues(groupFeature, newColumnValues, operatorPair);
                        var value        = newColumnValues[operatorPair.ColumnName];
                        var resultColumn = filteredFeatureColumns.FirstOrDefault(c => c.ColumnName.Equals(operatorPair.ColumnName));
                        if (resultColumn != null)
                        {
                            if (resultColumn.MaxLength < value.Length)
                            {
                                var indexOf = filteredFeatureColumns.IndexOf(resultColumn);
                                filteredFeatureColumns.RemoveAt(indexOf);
                                var newColumn = new FeatureSourceColumn(resultColumn.ColumnName, resultColumn.TypeName, value.Length);
                                filteredFeatureColumns.Insert(indexOf, newColumn);
                            }
                        }
                    }

                    newColumnValues.Add("Count", groupFeature.Count().ToString());

                    try
                    {
                        if (finalProcessAction != null)
                        {
                            finalProcessAction(groupFeature, newColumnValues);
                        }
                    }
                    catch (Exception e)
                    {
                        GisEditor.LoggerManager.Log(LoggerLevel.Debug, e.Message, new ExceptionInfo(e));
                        throw e;
                    }
                });
            });

            foreach (var groupByType in featureGroupByShapeType)
            {
                try
                {
                    //CancelTask(this.CancellationSource.Token, content, parameter);
                    if (groupByType.Key.IsSubclassOf(typeof(AreaBaseShape)))
                    {
                        dissolveAction(groupByType, (tmpFeatures, tmpColumnValues) =>
                        {
                            //MultipolygonShape dissolveShape = AreaBaseShape.Union(GetValidFeatures(tmpFeatures));
                            List <AreaBaseShape> areaShapes = GetValidFeatures(tmpFeatures)
                                                              .Select(f => f.GetShape())
                                                              .OfType <AreaBaseShape>()
                                                              .ToList();

                            MultipolygonShape dissolveShape = (MultipolygonShape)SqlTypesGeometryHelper.Union(areaShapes);

                            if (dissolveShape != null)
                            {
                                Feature dissolveFeature = new Feature(dissolveShape, tmpColumnValues);
                                dissolvedFeatures.Add(dissolveFeature);
                            }
                        });
                    }
                    else if (groupByType.Key.IsSubclassOf(typeof(LineBaseShape)))
                    {
                        dissolveAction(groupByType, (tmpFeatures, tmpColumnValues) =>
                        {
                            MultilineShape dissolveShape = new MultilineShape();
                            tmpFeatures.ForEach(tmpFeature =>
                            {
                                BaseShape tmpShape      = tmpFeature.GetShape();
                                LineShape tmpLine       = tmpShape as LineShape;
                                MultilineShape tmpMLine = tmpShape as MultilineShape;
                                if (tmpLine != null)
                                {
                                    dissolveShape.Lines.Add(tmpLine);
                                }
                                else if (tmpMLine != null)
                                {
                                    tmpMLine.Lines.ForEach(tmpLineInMLine => dissolveShape.Lines.Add(tmpLineInMLine));
                                }
                            });

                            if (dissolveShape.Lines.Count > 0)
                            {
                                dissolvedFeatures.Add(new Feature(dissolveShape, tmpColumnValues));
                            }
                        });
                    }
                    else if (groupByType.Key.IsSubclassOf(typeof(PointBaseShape)))
                    {
                        dissolveAction(groupByType, (tmpFeatures, tmpColumnValues) =>
                        {
                            MultipointShape multipointShape = new MultipointShape();
                            tmpFeatures.ForEach(tmpFeature =>
                            {
                                BaseShape tmpShape        = tmpFeature.GetShape();
                                PointShape tmpPoint       = tmpShape as PointShape;
                                MultipointShape tmpMPoint = tmpShape as MultipointShape;
                                if (tmpPoint != null)
                                {
                                    multipointShape.Points.Add(tmpPoint);
                                }
                                else if (tmpMPoint != null)
                                {
                                    tmpMPoint.Points.ForEach(tmpPointInMPointShape => multipointShape.Points.Add(tmpPointInMPointShape));
                                }
                            });
                            dissolvedFeatures.Add(new Feature(multipointShape, tmpColumnValues));
                        });
                    }
                    if (isCanceled)
                    {
                        break;
                    }
                }
                catch (Exception ex)
                {
                    var errorEventArgs = new UpdatingTaskProgressEventArgs(TaskState.Error);
                    errorEventArgs.Error = new ExceptionInfo(string.Format(CultureInfo.InvariantCulture, "Feature id: {0}, {1}"
                                                                           , groupByType.FirstOrDefault().Id, ex.Message)
                                                             , ex.StackTrace
                                                             , ex.Source);
                    GisEditor.LoggerManager.Log(LoggerLevel.Debug, ex.Message, new ExceptionInfo(ex));
                    errorEventArgs.Message = groupByType.FirstOrDefault().Id;
                    OnUpdatingProgress(errorEventArgs);
                    continue;
                }
            }
            if (!isCanceled)
            {
                string saveFolder = Path.GetDirectoryName(outputPathFileName);
                if (!Directory.Exists(saveFolder))
                {
                    Directory.CreateDirectory(saveFolder);
                }

                var info = new FileExportInfo(dissolvedFeatures, filteredFeatureColumns, outputPathFileName, Wkt);
                Export(info);
            }
        }