【问题标题】:Looping Through Temporal Dataset遍历时态数据集
【发布时间】:2015-08-04 19:46:15
【问题描述】:

我有一个包含时态数据列的点要素类。我将如何收集前 10 年数据的平均中心,然后是前 20 年、前 30 年等......并使用 Python 循环将结果导出为点?我想测量数据随时间的人口变化,而不必手动计算每十年的影响。

如果这是一个幼稚的问题,我深表歉意,因为我刚刚开始编程。

下面的链接包含一个文件地理数据库,其中包含我正在使用的要素类。

https://drive.google.com/file/d/0Bw8dHpiUsYU7QjlKQnRSaDV5RnM/view?usp=sharing

【问题讨论】:

    标签: python gis arcpy


    【解决方案1】:

    我最终选择了这样的东西。

    import os
    import arcpy
    
    in_feature = "C:\\temp\\mlb_birth.gdb\\mlb_birthplaces"
    out_features = "C:\\temp\\mlb_birth.gdb"
    
    for x in range(10, 140, 10):
        year_range = int(1870 + x)
    
        year_out_name = os.path.join(out_features, "Years_{0}".format(x))
        mean_out_name = os.path.join(out_features, "Mean_{0}".format(x))
    
        arcpy.Select_analysis(in_feature, year_out_name, "birthYear <= {0}".format(year_range))
    
        arcpy.MeanCenter_stats(year_out_name, mean_out_name, "#", "#", "#")
    

    【讨论】:

      猜你喜欢
      • 2012-06-05
      • 1970-01-01
      • 1970-01-01
      • 2023-04-10
      • 1970-01-01
      • 1970-01-01
      • 2017-10-23
      • 2017-10-31
      • 2018-12-14
      相关资源
      最近更新 更多