コード例 #1
0
 /// <summary>
 /// 构建道路的R树,需要一段时间,最好用多线程
 /// </summary>
 public void BuildRoadRtree()
 {
     _RoadRtree = new StRtree();
     foreach (var item in _Roads)
     {
         _RoadRtree.Insert(item.Envelope, item);
     }
     _RoadRtree.Build();
 }
コード例 #2
0
 /// <summary>
 /// 构建道路段的R树,所需时间更长,最好用多线程
 /// </summary>
 public void BuildRoadSegmentRtree()
 {
     _RoadSegmentRtree = new StRtree();
     foreach (var item in _Roads)
     {
         var segs = item.GetRoadSegments();
         foreach (var seg in segs)
         {
             RoadSegmentRtree.Insert(seg.GetOptimizeEnvelop(), seg);
         }
     }
     _RoadSegmentRtree.Build();
 }
コード例 #3
0
 private void BulidRTree()
 {
     try
     {
         segmentationRTree = new StRtree();
         foreach (var item in trajData)
         {
             for (int i = 0; i < item.GPSCount - 1; i++)
             {
                 GPSSegmentation gg = item.GetSeqmentationAtIndex(i);
                 segmentationRTree.Insert(gg.GetOptimizeEnvelop(), gg);
             }
         }
         segmentationRTree.Build();
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }