next up previous index
Next: Definition through Expressions Up: Using Opus Attributes in Previous: Definition through Fully-qualified Name   Index

Definition through Aggregation

Attributes can also be specified as aggregations of primary or computed attributes. For example:

In these examples, an attribute defined at a particular geographic dataset is aggregated to a larger dataset. For example, zone.aggregate(gridcell.residential_units, function=sum) will, for every zone, sum the residential_units of all gridcells that comprise that zone. The second example, alldata.aggregate_all(urbansim.zone.number_of_home_based_jobs, function=sum), will result in a single value because the alldata dataset represents a single regional value. The number of home-based jobs in all zones will be added together to produce a single region-level total.


next up previous index
Next: Definition through Expressions Up: Using Opus Attributes in Previous: Definition through Fully-qualified Name   Index
info (at) urbansim.org