Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am using arcgis 10.1 I am currently doing a lot of sql query feature class and I am thinking of automating this process

so far my escrip is as follows

import arcpy
arcpy.SelectLayerByAttribute_management("casa","NEW_SELECTION"," [color] = 'blanco' ")

then I get a count of the selected

contador = int(arcpy.GetCount_management("casa").getOutput(0))
print contador

88

then do another query on the same feature class and I get him the count and repeat this process as many times

on the same feature class conducted many consultations

my first question is how could I modify this scrip to use and able to put in modelbuider as input parameter one feature class and make all of these query as defined in escrip

my second question if I could list all the results it gives me the count of each query and export them to a table

share|improve this question
1  
Have you considered using the Summary Statistics (Analysis) tool rather than Python/ModelBuilder to do this? –  PolyGeo Dec 15 '13 at 7:23
    
thanks friend was checking tool and meets my needs –  user22547 Dec 15 '13 at 19:24
add comment

1 Answer

Rather than using a method like that you describe in your Question, I recommend that you investigate the Summary Statistics (Analysis) tool which has COUNT as one of its available statistic types.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.