예제 #1
0
        private void IntersectChains()
        {
            MonotoneChainOverlapAction overlapAction =
                new SegmentOverlapAction(this, segInt);

            for (IEnumerator i = monoChains.GetEnumerator(); i.MoveNext();)
            {
                MonotoneChain queryChain    = (MonotoneChain)i.Current;
                IList         overlapChains = index.Query(queryChain.Envelope);

                for (IEnumerator j = overlapChains.GetEnumerator(); j.MoveNext();)
                {
                    MonotoneChain testChain = (MonotoneChain)j.Current;
                    // following test makes sure we only compare each pair of chains once
                    // and that we don't compare a chain to itself
                    if (testChain.Id > queryChain.Id)
                    {
                        queryChain.ComputeOverlaps(testChain, overlapAction);
                        nOverlaps++;
                    }
                }
            }
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        private void IntersectChains()
        {
            MonotoneChainOverlapAction overlapAction = new SegmentOverlapAction(SegmentIntersector);

            foreach (object obj in monoChains)
            {
                MonotoneChain queryChain    = (MonotoneChain)obj;
                IList         overlapChains = index.Query(queryChain.Envelope);
                foreach (object j in overlapChains)
                {
                    MonotoneChain testChain = (MonotoneChain)j;

                    /*
                     * following test makes sure we only compare each pair of chains once
                     * and that we don't compare a chain to itself
                     */
                    if (testChain.Id > queryChain.Id)
                    {
                        queryChain.ComputeOverlaps(testChain, overlapAction);
                        nOverlaps++;
                    }
                }
            }
        }