Daily Snippet, Developer to developer

python’s time:count data in each layer of your ArcSDE feature dataset

## Script untuk menghitung jumlah data masing-masing layer di dataset.
## Inputan : Feature Dataset.
## Dilakukan per unit.
import sys, os, re, arcgisscripting

try:
    gp = arcgisscripting.create()
    inDataset = gp.GetParameterAsText(0)
    unit = gp.GetParameterAsText(1)
    gp.AddMessage("Rekap jumlah data layer aktif unit %s " % unit)
    gp.workspace = inDataset

    # Get a list of feature classes in the workspace.
    fcs = gp.ListFeatureClasses()
        
    # Loop through the list of feature classes.
    fcs.reset()
    fc = fcs.next()    

    while fc:
        gp.AddMessage("Sedang memproses %s " % fc)
        dsc = gp.Describe(fc)
       
        strPrint = "Jumlah data %s = %s " % (fc,gp.GetCount_management(fc))
        gp.AddMessage(strPrint)
        
        fc = fcs.next()
except Exception, ErrorDesc:
    gp.AddError("error %s" % str(ErrorDesc))
    print("error %s" % str(ErrorDesc)) 
Standard

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s