YouTube | Facebook | X(Twitter) | RSS

フィーチャ レイヤの作成

2016/9/1 (木)

import arcpy
try:
    fc = r"D:\Student\PYTH\Database\SanDiego.gdb\Climate"
    layer_name = "temp_layer"
    result = arcpy.MakeFeatureLayer_management(fc, layer_name)
 
    featurelayer = result.getOutput(0)
 
 
    # Create a describe object
    desc = arcpy.Describe(layer_name)
 
    # If a feature layer, continue
    if desc.dataType == "FeatureLayer":
 
        # Create a fieldinfo object
        fieldInfo = desc.fieldInfo
 
        index = 0
 
        # Use the count property to iterate through all the fields
        while index < fieldInfo.count:
            # Print fieldinfo properties to the screen
            #
            print "Field Name: " + fieldInfo.getFieldName(index)
            print "\tNew Name:   " + fieldInfo.getNewName(index)
            print "\tSplit Rule: " + fieldInfo.getSplitRule(index)
            print "\tVisible:    " + fieldInfo.getVisible(index)
            index += 1
 
except arcpy.ExecuteError as e:
    print str(e).decode("UTF-8")

関連記事

  • この記事を書いた人

羽田 康祐

伊達と酔狂のGISエンジニア。GIS上級技術者、Esri認定インストラクター、CompTIA CTT+ Classroom Trainer、潜水士、PADIダイブマスター、四アマ。WordPress は 2.1 からのユーザーで歴だけは長い。 代表著書『地図リテラシー入門―地図の正しい読み方・描き方がわかる』 GIS を使った自己紹介はこちら。ESRIジャパン(株)所属、元青山学院大学非常勤講師を兼務。日本地図学会第31期常任委員。発言は個人の見解です。

-プログラミング, ArcGIS
-

WINGFIELD since1981をもっと見る

今すぐ購読し、続きを読んで、すべてのアーカイブにアクセスしましょう。

続きを読む