-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapply_transfer_table.py
31 lines (27 loc) · 1.23 KB
/
apply_transfer_table.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
28
29
30
31
'''Areally interpolate quantities using a transfer table.'''
import rum
import rum.util
argparser = rum.defaultArgumentParser(__doc__)
argparser.add_argument('from_table',
help='table with polygon geometry and an identifier to transfer values from'
)
argparser.add_argument('from_id_field', help='unique identifier column in from_table')
argparser.add_argument('to_table',
help='table with polygon geometry and an identifier to transfer values to'
)
argparser.add_argument('to_id_field', help='unique identifier column in to_table')
argparser.add_argument('value_field', help='field in from_table with values to be interpolated')
argparser.add_argument('transfer_table', help='transfer weight table')
argparser.add_argument('output_table', help='output table with interpolated values')
argparser.add_argument('-o', '--overwrite', action='store_true',
help='overwrite existing transfer weight table')
if __name__ == '__main__':
args = argparser.parse_args()
rum.util.TransferWeightApplier.fromArgs(args).run(
args.from_table, args.from_id_field,
args.value_field,
args.to_table, args.to_id_field,
transferTable=args.transfer_table,
outputTable=args.output_table,
overwrite=args.overwrite
)