private static void Insert(IEnumerable <Envelope> sourceData, ISpatialIndex <object> index)
 {
     foreach (var envelope in sourceData)
     {
         index.Insert(envelope, envelope);
     }
 }
 private void Insert(IList <Envelope> sourceData, ISpatialIndex <object> index)
 {
     foreach (var envelope in sourceData)
     {
         index.Insert(envelope, envelope);
     }
 }
 private static void Insert(IEnumerable<Envelope> sourceData, ISpatialIndex<object> index)
 {
     foreach (var envelope in sourceData)
     {
         index.Insert(envelope, envelope);
     }
 }
 private void Insert(IList<Envelope> sourceData, ISpatialIndex<object> index)
 {
     foreach (var envelope in sourceData)
     {
         index.Insert(envelope, envelope);
     }
 }
Esempio n. 5
0
 private void BuildTreeInMemo()
 {
     foreach (var recHeader in this._ShxFile.Records)
     {
         FeatureLite rec = _ShpFile.ReaderShape(recHeader.Offset, recHeader.ContentLength);
         _SpatialIndex.Insert(rec.FeatureID, rec.MBR);
     }
 }
Esempio n. 6
0
        private static void addEntry(IList <BoundedInt32> entries, BoundedInt32 entry, ISpatialIndex <IExtents, BoundedInt32> rTree)
        {
            if (entries != null)
            {
                entries.Add(entry);
            }

            rTree.Insert(entry);
        }
        private void BuildIndex()
        {
            _index = new STRtree <ILineString>();

            for (int i = 0; i < _rings.Count; i++)
            {
                var ring = (ILinearRing)_rings[i];
                var env  = ring.EnvelopeInternal;
                _index.Insert(env, ring);
            }
        }
Esempio n. 8
0
 private static void LoadGrid(int side, ISpatialIndex <object> index)
 {
     for (int i = 0; i < side; i++)
     {
         for (int j = 0; j < side; j++)
         {
             var env = new Envelope(i, i + ITEM_ENV_SIZE, j, j + ITEM_ENV_SIZE);
             index.Insert(env, i + "-" + j);
         }
     }
 }
        /// <summary>
        ///
        /// </summary>
        private void BuildQuadtree()
        {
            _quadtree = new Quadtree <LinearRing>();

            for (int i = 0; i < _rings.Count; i++)
            {
                var ring = _rings[i];
                var env  = ring.EnvelopeInternal;
                _quadtree.Insert(env, ring);
            }
        }
Esempio n. 10
0
        private void addRandomEntries(ISpatialIndex <IExtents, BoundedInt32> rTree)
        {
            Random rnd = new MersenneTwister();

            for (Int32 i = 0; i < 100000; i++)
            {
                Double xMin = rnd.NextDouble() * (rnd.Next(0, 1) == 1 ? -1 : 1) * rnd.Next();
                Double xMax = rnd.NextDouble() * (rnd.Next(0, 1) == 1 ? -1 : 1) * rnd.Next();
                Double yMin = rnd.NextDouble() * (rnd.Next(0, 1) == 1 ? -1 : 1) * rnd.Next();
                Double yMax = rnd.NextDouble() * (rnd.Next(0, 1) == 1 ? -1 : 1) * rnd.Next();

                IExtents bounds = _factories.GeoFactory.CreateExtents2D(xMin, yMin, xMax, yMax);
                rTree.Insert(new BoundedInt32(i, bounds));
            }
        }
Esempio n. 11
0
        private void FillSpatialIndex()
        {
            bool isAsync = m_CancellationTokenSrc != null;

            foreach (MBRInfo mbrInfo in m_ShapeReader.ReadMBRs())
            {
                if (isAsync && m_CancellationTokenSrc.IsCancellationRequested)
                {
                    break;
                }

                m_SpatialIndex.Insert(mbrInfo.ShapeMBR, mbrInfo.ShapeFileDetails);
            }

            m_IsIndexingComplete = true;
        }
Esempio n. 12
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="seg"></param>
 public void Add(LineSegment seg)
 {
     _index.Insert(new Envelope(seg.P0, seg.P1), seg);
 }
Esempio n. 13
0
 /// <summary>
 /// Insert an edge unless it is already in the list.
 /// </summary>
 /// <param name="e"></param>
 public void Add(Edge e)
 {
     edges.Add(e);
     index.Insert(e.Envelope, e);
 }
Esempio n. 14
0
 /// <summary>
 /// Insert an edge unless it is already in the list.
 /// </summary>
 /// <param name="e"></param>
 public virtual void Add(Edge e)
 {
     _edges.Add(e);
     _index.Insert(e.Envelope, e);
 }
        private void BuildIndex()
        {
            _index = new STRtree<ILineString>();

            for (int i = 0; i < _rings.Count; i++)
            {
                var ring = (ILinearRing)_rings[i];
                var env = ring.EnvelopeInternal;
                _index.Insert(env, ring);
            }
        }
        /// <summary>
        /// 
        /// </summary>
        private void BuildQuadtree()
        {
            _quadtree = new Quadtree<ILinearRing>();

            for (int i = 0; i < _rings.Count; i++)
            {
                ILinearRing ring = _rings[i];
                Envelope env = ring.EnvelopeInternal;
                _quadtree.Insert(env, ring);
            }
        }