private ICollection <IFeature> GetConnectedBorderFeatures(
            [NotNull] IPoint point,
            [NotNull] IFeature lineFeature, int lineClassIndex,
            int borderClassIndex)
        {
            ITable borderClass = InvolvedTables[borderClassIndex];

            ISpatialFilter spatialFilter = _filters[borderClassIndex];

            spatialFilter.Geometry = point;

            var result = new List <IFeature>(5);

            BorderMatchCondition borderMatchCondition =
                GetBorderMatchCondition(lineClassIndex);

            foreach (IRow borderRow in Search(borderClass,
                                              spatialFilter,
                                              _filterHelpers[borderClassIndex]))
            {
                if (!borderMatchCondition.IsFulfilled(lineFeature, lineClassIndex,
                                                      borderRow, borderClassIndex))
                {
                    continue;
                }

                result.Add((IFeature)borderRow);
            }

            return(result);
        }
        private bool IsCoincidentWithNeighborBorder(
            [NotNull] BorderConnection borderConnection,
            [NotNull] IFeature neighborFeature, int neighborLineClassIndex,
            int neighborBorderClassIndex)
        {
            ITable neighborBorderClass = InvolvedTables[neighborBorderClassIndex];

            ISpatialFilter spatialFilter = _filters[neighborBorderClassIndex];

            spatialFilter.Geometry = borderConnection.Point;

            BorderMatchCondition neighborBorderMatchCondition =
                GetBorderMatchCondition(neighborLineClassIndex);

            foreach (IRow borderRow in Search(neighborBorderClass,
                                              spatialFilter,
                                              _filterHelpers[neighborBorderClassIndex]))
            {
                if (neighborBorderMatchCondition.IsFulfilled(neighborFeature,
                                                             neighborLineClassIndex,
                                                             borderRow,
                                                             neighborBorderClassIndex))
                {
                    return(true);
                }
            }

            return(false);
        }