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 trying to solve following problem. I need to select features from the shapefile by attribute in Model builder. The attribute should be a statistics which you can calculate by the tool :"Summary statistics". This creates new table with mean and stdev from the original shapefile attribute table. I need to use those numbers in the selection of features of the original layer. Is there some way, how to do this?

Practically I am trying to do a very easy procedure, a lot of people do in the ArcMap regullarly. To classify feature by the standard deviation. Take the range of features above the specified stdev level and make a new layer of this. Shame that there is not such tool like Reclassify for rasters which would work for the features as well where the only thing you should do is to load layer symbology and say that one of the classes is preserved and the others are lost.

share|improve this question
add comment

2 Answers

You can do it following these steps:

  1. Define a case field within the Summary Statistics tool (some sort of ID field).
  2. Use Join Field tool to join the summary table (by case field) back to your original layer
  3. Use Feature Class to Feature Class tool to export out a new shapefile which includes the new statistic fields
  4. Use Select Layer by Attribute tool to define your selection based on your expression

Hope that helps.

share|improve this answer
    
Thank you, I tried that, but in that case, it will count statistics of each row of the table and not the whole table. I need to get statistics of the all records in every row. That appears to be quite a problem. So, it works for one row, where I set the FID as "0" and this one-row table jonin to the original. Then I have one row with statistics. But Now, I dont know how to copy the records from first row to the rest of rows in Model Builder. (Note, the model will work with different inputs, so there will be no exact numbers of stats known.) Thank you for your answer and help. Cheers, Jan –  Jan Jelenek Jun 10 '13 at 8:46
    
OK, so I decided, that it is probably not possible to do it by ordinary tools. So, I solved it by writing a Python script. That was actually very easy. –  Jan Jelenek Jun 13 '13 at 12:54
add comment

I know this is an old thread, but I think there are much easier answers to your question.

If you want to classify your data by Standard Deviation, you can choose this classification option under the Symbology tab of Layer Properties. Once you do that, you can see, very rapidly, where the stdev breakpoints are, and can then use those breakpoints in any subsequent selection.

To do this in ModelBuilder, run the Summary Statistics tool, but run it without selecting a Case Field. (However, if your feature class has a field that contains the same value for all records -- definitely not an ID -- use that as the Case Field and join your original table on that field. Very simple. It's easy to create and populate that field in ModelBuilder by adding the Add Field and Calculate Field tools.)

But if you don't have that kind of field and don't want to make one, you can "extract" the stdev value from the Summary Statistics output table by using the Get Field Value tool.

You can then use the output of Get Field Value as the input (by using the "inline variable" concept) for a Select or Select Layer By tool.

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.