Hello:

I am attempting to calculate linear mileage of stream data for three predefined fields in model builder. The conceptual approach is to calculate all segments mileage in the first field (total_miles), then calculate a fraction of the records in another field (need_miles), and finally, calculate the percentage of the two in the final field (percentage). I'll use frequency to agregate the segments to their respective HUC 12 areas. The problem I am having, is how to calculate geometry (linear mileage) in model builder? I can't seem to locate the tool that may be dragged to model builder. Thanks so much in advance!!!!

I am attempting to calculate linear mileage of stream data for three predefined fields in model builder. The conceptual approach is to calculate all segments mileage in the first field (total_miles), then calculate a fraction of the records in another field (need_miles), and finally, calculate the percentage of the two in the final field (percentage). I'll use frequency to agregate the segments to their respective HUC 12 areas. The problem I am having, is how to calculate geometry (linear mileage) in model builder? I can't seem to locate the tool that may be dragged to model builder. Thanks so much in advance!!!!

A few ways to do this. Sum the Length value in the frequency in whatever units they are listed (assming this is a geodatabase and not a shapefile), then do the conversion to miles at the join and calculation stage. If you are using a shapefile, first calculate a field called MILES using the Field Calculator tool. The python calculation to get the length of a line and make the appropriate units conversion is:

Parser: Python

Pre-Logic Code:

def Output(Length):

return Length / 5280 # assumes that shape length is in Feet and is being converted to Miles.

Expression:

Output(!SHAPE.LENGTH!)

now sum the MILES field values in your frequency and you can get the all of the fields filled in that you need.