internal static com.epl.geometry.Geometry MultiPointMinusEnvelope_(com.epl.geometry.MultiPoint multi_point, com.epl.geometry.Envelope envelope, double tolerance, com.epl.geometry.ProgressTracker progress_tracker)
        {
            com.epl.geometry.Envelope2D env = new com.epl.geometry.Envelope2D();
            envelope.QueryEnvelope2D(env);
            env.Inflate(tolerance, tolerance);
            int  point_count     = multi_point.GetPointCount();
            bool b_found_covered = false;

            bool[] covered = new bool[point_count];
            for (int i = 0; i < point_count; i++)
            {
                covered[i] = false;
            }
            com.epl.geometry.Point2D pt = new com.epl.geometry.Point2D();
            for (int i_1 = 0; i_1 < point_count; i_1++)
            {
                multi_point.GetXY(i_1, pt);
                if (!env.Contains(pt))
                {
                    continue;
                }
                b_found_covered = true;
                covered[i_1]    = true;
            }
            if (!b_found_covered)
            {
                return(multi_point);
            }
            com.epl.geometry.MultiPoint new_multipoint = (com.epl.geometry.MultiPoint)multi_point.CreateInstance();
            for (int i_2 = 0; i_2 < point_count; i_2++)
            {
                if (!covered[i_2])
                {
                    new_multipoint.Add(multi_point, i_2, i_2 + 1);
                }
            }
            return(new_multipoint);
        }
        internal static com.epl.geometry.Geometry MultiPointMinusPoint_(com.epl.geometry.MultiPoint multi_point, com.epl.geometry.Point point, double tolerance, com.epl.geometry.ProgressTracker progress_tracker)
        {
            com.epl.geometry.MultiPointImpl       multipointImpl = (com.epl.geometry.MultiPointImpl)(multi_point._getImpl());
            com.epl.geometry.AttributeStreamOfDbl position       = (com.epl.geometry.AttributeStreamOfDbl)(multipointImpl.GetAttributeStreamRef(com.epl.geometry.VertexDescription.Semantics.POSITION));
            int point_count = multi_point.GetPointCount();

            com.epl.geometry.Point2D point2D = point.GetXY();
            com.epl.geometry.Point2D pt      = new com.epl.geometry.Point2D();
            bool b_found_covered             = false;

            bool[] covered = new bool[point_count];
            for (int i = 0; i < point_count; i++)
            {
                covered[i] = false;
            }
            double tolerance_cluster    = tolerance * System.Math.Sqrt(2.0) * 1.00001;
            double tolerance_cluster_sq = tolerance_cluster * tolerance_cluster;

            for (int i_1 = 0; i_1 < point_count; i_1++)
            {
                position.Read(2 * i_1, pt);
                double sqr_dist = com.epl.geometry.Point2D.SqrDistance(pt, point2D);
                if (sqr_dist <= tolerance_cluster_sq)
                {
                    b_found_covered = true;
                    covered[i_1]    = true;
                }
            }
            if (!b_found_covered)
            {
                return(multi_point);
            }
            com.epl.geometry.MultiPoint new_multipoint = (com.epl.geometry.MultiPoint)(multi_point.CreateInstance());
            for (int i_2 = 0; i_2 < point_count; i_2++)
            {
                if (!covered[i_2])
                {
                    new_multipoint.Add(multi_point, i_2, i_2 + 1);
                }
            }
            return(new_multipoint);
        }
        internal static com.epl.geometry.Geometry MultiPointSymDiffPoint_(com.epl.geometry.MultiPoint multi_point, com.epl.geometry.Point point, double tolerance, com.epl.geometry.ProgressTracker progress_tracker)
        {
            com.epl.geometry.MultiPointImpl       multipointImpl = (com.epl.geometry.MultiPointImpl)(multi_point._getImpl());
            com.epl.geometry.AttributeStreamOfDbl position       = (com.epl.geometry.AttributeStreamOfDbl)(multipointImpl.GetAttributeStreamRef(com.epl.geometry.VertexDescription.Semantics.POSITION));
            int point_count = multi_point.GetPointCount();

            com.epl.geometry.Point2D    point2D        = point.GetXY();
            com.epl.geometry.MultiPoint new_multipoint = (com.epl.geometry.MultiPoint)(multi_point.CreateInstance());
            double tolerance_cluster = tolerance * System.Math.Sqrt(2.0) * 1.00001;

            com.epl.geometry.Envelope2D env = new com.epl.geometry.Envelope2D();
            multi_point.QueryEnvelope2D(env);
            env.Inflate(tolerance_cluster, tolerance_cluster);
            if (env.Contains(point2D))
            {
                double tolerance_cluster_sq = tolerance_cluster * tolerance_cluster;
                bool   b_found_covered      = false;
                bool[] covered = new bool[point_count];
                for (int i = 0; i < point_count; i++)
                {
                    covered[i] = false;
                }
                for (int i_1 = 0; i_1 < point_count; i_1++)
                {
                    double x  = position.Read(2 * i_1);
                    double y  = position.Read(2 * i_1 + 1);
                    double dx = x - point2D.x;
                    double dy = y - point2D.y;
                    if (dx * dx + dy * dy <= tolerance_cluster_sq)
                    {
                        b_found_covered = true;
                        covered[i_1]    = true;
                    }
                }
                if (!b_found_covered)
                {
                    new_multipoint.Add(multi_point, 0, point_count);
                    new_multipoint.Add(point);
                }
                else
                {
                    for (int i_2 = 0; i_2 < point_count; i_2++)
                    {
                        if (!covered[i_2])
                        {
                            new_multipoint.Add(multi_point, i_2, i_2 + 1);
                        }
                    }
                }
            }
            else
            {
                new_multipoint.Add(multi_point, 0, point_count);
                new_multipoint.Add(point);
            }
            return(new_multipoint);
        }