ขนาดวิดีโอ: 1280 X 720853 X 480640 X 360
แสดงแผงควบคุมโปรแกรมเล่น
เล่นอัตโนมัติ
เล่นใหม่
>>> import arcpy... ... # Define the shapefile path... shapefile_path = r"D:\PULSE Jhelum\only khasra\79695_DIWALIAN\VECTOR_FINAL\79695_DIWALIAN_KHASRA.shp"... ... # User inputs... District = "Jhelum" #Jhelum,Chakwal,Talagang... Dist_ID = 37... Tehsil = "Jhelum"... Tehsil_ID = 129... QH = "Kala Gojran"... QH_ID = 764... PC = "Jakkar"... PC_ID = 6979... Mouza = "Bahbondana Gargan"... Mouza_ID = 80287... Karam = 5.5... Type = "Kishtwar"... ... # Create a list of fields and corresponding values... fields = ["District", "Dist_ID", "Tehsil", "Tehsil_ID", "QH", "QH_ID", "PC", "PC_ID", "Mouza", "Mouza_ID", "Karam", "Type"]... values = [District, Dist_ID, Tehsil, Tehsil_ID, QH, QH_ID, PC, PC_ID, Mouza, Mouza_ID, Karam, Type]... ... # Start an edit session and update the fields... with arcpy.da.UpdateCursor(shapefile_path, fields) as cursor:... for row in cursor:... for i in range(len(fields)):... row[i] = values[i]... cursor.updateRow(row)... ... print("Fields updated successfully.")
>>> import arcpy
...
... # Define the shapefile path
... shapefile_path = r"D:\PULSE Jhelum\only khasra\79695_DIWALIAN\VECTOR_FINAL\79695_DIWALIAN_KHASRA.shp"
...
... # User inputs
... District = "Jhelum" #Jhelum,Chakwal,Talagang
... Dist_ID = 37
... Tehsil = "Jhelum"
... Tehsil_ID = 129
... QH = "Kala Gojran"
... QH_ID = 764
... PC = "Jakkar"
... PC_ID = 6979
... Mouza = "Bahbondana Gargan"
... Mouza_ID = 80287
... Karam = 5.5
... Type = "Kishtwar"
...
... # Create a list of fields and corresponding values
... fields = ["District", "Dist_ID", "Tehsil", "Tehsil_ID", "QH", "QH_ID", "PC", "PC_ID", "Mouza", "Mouza_ID", "Karam", "Type"]
... values = [District, Dist_ID, Tehsil, Tehsil_ID, QH, QH_ID, PC, PC_ID, Mouza, Mouza_ID, Karam, Type]
...
... # Start an edit session and update the fields
... with arcpy.da.UpdateCursor(shapefile_path, fields) as cursor:
... for row in cursor:
... for i in range(len(fields)):
... row[i] = values[i]
... cursor.updateRow(row)
...
... print("Fields updated successfully.")