VisitLog.LogMS "记录所有的FeatureKey"
  '遍历Allfeature记录
  For i = 1 To main.Map1.Layers.Item("观测站").AllFeatures.Count
     h1.Add main.Map1.DataSets.Item("观测站").Value(main.Map1.Layers.Item("观测站").AllFeatures(i).FeatureKey, "Name"), main.Map1.Layers.Item("观测站").AllFeatures(i).FeatureKey
  Next
  VisitLog.LogMS "完成记录所有的FeatureKey"


结果

46:27.158记录所有的FeatureKey

46:57.767完成记录所有的FeatureKey


总共才167个点。

--------------------------------------------------------------------------
改用for each

  Dim ftr As Feature
  For Each ftr In main.Map1.Layers.Item("¹Û²âÕ¾").AllFeatures
    h1.Add main.Map1.DataSets.Item("¹Û²âÕ¾").Value(ftr.FeatureKey, "Name"), ftr.FeatureKey

  Next

结果:

15:06.882记录所有的FeatureKey

15:08.007完成记录所有的FeatureKey

=================================================
结论:
        mapx的allfeature的item索引是一个非常间接的处理,需要耗费大量的处理时间。

相关文章:

  • 2021-08-27
  • 2022-01-13
  • 2021-10-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-12
  • 2022-12-23
猜你喜欢
  • 2021-12-08
  • 2022-12-23
  • 2021-12-04
  • 2021-08-22
  • 2022-01-05
  • 2021-07-09
  • 2021-12-22
相关资源
相似解决方案