-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathuiGroup.py
More file actions
35 lines (32 loc) · 1.04 KB
/
uiGroup.py
File metadata and controls
35 lines (32 loc) · 1.04 KB
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
32
33
34
35
import sys
import lib.som.group
def group(inName,groupBy,groupType,valueType,outName,sortBy,decimalPlaces):
"""
Groups shapes in a shapefile using the specified parameters.
:arguments:
inName
The input shapefile name.
groupBy
The data column to group on.
groupType
The type of grouping to create.
valueType
The type of value to place in the final ouput.
outName
The output shapefile name.
sortBy (*optional*)
A column to sort the data by before grouping.
"""
lib.som.group.group(inName,groupBy,groupType,valueType,outName,sortBy,decimalPlaces)
if __name__=="__main__":
inName=sys.argv[1]
groupBy=sys.argv[2]
groupType=lib.som.group.groupTypes[sys.argv[3]]
valueType=lib.som.group.valueTypes[sys.argv[4]]
outName=sys.argv[5]
if sys.argv[6]=="#":
sortBy=None
else:
sortBy=sys.argv[6]
decimalPlaces=int(sys.argv[7])
group(inName,groupBy,groupType,valueType,outName,sortBy,decimalPlaces)