-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisaggregate_batch.py
27 lines (24 loc) · 1001 Bytes
/
disaggregate_batch.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'''Disaggregate values from a layer to grid using multiple predicted weights.'''
import rum
import rum.util
argparser = rum.defaultArgumentParser(__doc__)
argparser.add_argument('disag_table',
help='table with polygon geometry and values to disaggregate')
argparser.add_argument('disag_field', help='field in disag_table to disaggregate')
argparser.add_argument('weight_table',
help='table with disaggregation weight fields'
)
argparser.add_argument('output_table',
help='table with disaggregated values'
)
argparser.add_argument('-r', '--relative', action='store_true',
help='the values in disaggregation field are relative')
argparser.add_argument('-o', '--overwrite', action='store_true',
help='overwrite existing output table')
if __name__ == '__main__':
args = argparser.parse_args()
rum.util.BatchDisaggregator.fromArgs(args).run(
args.disag_table, args.disag_field,
args.weight_table, args.output_table,
args.relative, args.overwrite
)