Posts

Showing posts with the label batch

Power Of Phyton Scripting In ArcGIS ( Useful Codes)

Some Useful Phyton Codes For Batch Geoprocessing Batch Clip Geoprocessing Tool import arcpy import os # The workspace environment needs to be set before ListFeatureClasses # to identify which workspace the list will be based on arcpy.env.workspace = "c:/data" out_workspace = "c:/data/results/" clip_features = "c:/data/testarea/boundary.shp" # Loop through a list of feature classes in the workspace for fc in arcpy.ListFeatureClasses(): # Set the output name to be the same as the input name, and # locate in the 'out_workspace' workspace # output = os.path.join(out_workspace, fc) # Clip each input feature class in the list # arcpy.Clip_analysis(fc, clip_features, output, 0.1) Batch Save Layer In MXD # import Phyton Geoprocessing Module import arcpy # set up MXD location mxd = arcpy.mapping.MapDocument("E:\PII_Aceh2014\PII_Aceh2014\PETA INFRASTRUKTUR INDONESIA\ALBUM PETA\A3\Kabupaten\ACEHTAMIANG_201...

Power Of Phyton Scripting In ArcGIS (Example 2, Phyton As Batch Geoprocessor)

Pekerjaan GIS sebagian besar adalah pekerjaan berulang. Dalam artian, prosesnya selalu berkisar di dalam kerangka sistem (input - proses - output). Pekerjaan perulangan ini sering memakan waktu yang tidak sedikit, terlebih jika melibatkan data dalam jumlah banyak. Oleh karena itu cara - cara untuk mempersingkat pemrosesan selalu dicari oleh banyak pengguna GIS. Alhasil di dalam sebuah software GIS fungsi "batch processing" atau pemrosesan banyak data dalam sekali eksekusi merupakan hal yang esensial. Di dalam ArcGIS, fungsi batch dapat dilakukan setidaknya melalui empat cara. Pertama, batch grid geoprocessor yang dieksekusi dari ArcToolbox, kedua, Model Builder, ketiga, ArcObject Scripting, dan keempat Phyton Scripting. Dari aspek efisiensi kerja, scripting (ArcObject maupun Phyton) jelas lebih efisien daripada Batching toolbox dan pembuatan model. Alasannya, yang pertama reusable ( batch geoprocessor nature-nya tidak reusable, kecuali anda menyimpan log geoprocessing untuk...