-
Notifications
You must be signed in to change notification settings - Fork 5
/
refine_geocoder.json
201 lines (201 loc) · 6.5 KB
/
refine_geocoder.json
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
[
{
"op": "core/column-addition-by-fetching-urls",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"baseColumnName": "address",
"urlExpression": "grel:'https://nominatim.openstreetmap.org/search?format=jsonv2&limit=1&q=' + escape(value, 'url')",
"onError": "set-to-blank",
"newColumnName": "osm_json",
"columnInsertIndex": 1,
"delay": 0,
"cacheResponses": true,
"httpHeadersJson": [
{
"name": "authorization",
"value": ""
},
{
"name": "user-agent",
"value": "OpenRefine 3.6.2 [579a6f7]"
},
{
"name": "accept",
"value": "*/*"
}
],
"description": "Create column osm_json at index 1 by fetching URLs based on column address using expression grel:'https://nominatim.openstreetmap.org/search?format=jsonv2&limit=1&q=' + escape(value, 'url')"
},
{
"op": "core/column-addition",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"baseColumnName": "osm_json",
"expression": "grel:value.parseJson()[0].lon",
"onError": "set-to-blank",
"newColumnName": "osm_longitude",
"columnInsertIndex": 2,
"description": "Create column osm_longitude at index 2 based on column osm_json using expression grel:value.parseJson()[0].lon"
},
{
"op": "core/text-transform",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "osm_longitude",
"expression": "value.toNumber()",
"onError": "keep-original",
"repeat": false,
"repeatCount": 10,
"description": "Text transform on cells in column osm_longitude using expression value.toNumber()"
},
{
"op": "core/column-addition",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"baseColumnName": "osm_json",
"expression": "grel:value.parseJson()[0].lat",
"onError": "set-to-blank",
"newColumnName": "osm_latitude",
"columnInsertIndex": 2,
"description": "Create column osm_latitude at index 2 based on column osm_json using expression grel:value.parseJson()[0].lat"
},
{
"op": "core/text-transform",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "osm_latitude",
"expression": "value.toNumber()",
"onError": "keep-original",
"repeat": false,
"repeatCount": 10,
"description": "Text transform on cells in column osm_latitude using expression value.toNumber()"
},
{
"op": "core/column-addition",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"baseColumnName": "osm_json",
"expression": "grel:value.parseJson()[0].category",
"onError": "set-to-blank",
"newColumnName": "osm_category",
"columnInsertIndex": 2,
"description": "Create column osm_category at index 2 based on column osm_json using expression grel:value.parseJson()[0].category"
},
{
"op": "core/column-addition",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"baseColumnName": "osm_json",
"expression": "grel:value.parseJson()[0].type",
"onError": "set-to-blank",
"newColumnName": "osm_type",
"columnInsertIndex": 2,
"description": "Create column osm_type at index 2 based on column osm_json using expression grel:value.parseJson()[0].type"
},
{
"op": "core/column-removal",
"columnName": "osm_json",
"description": "Remove column osm_json"
},
{
"op": "core/column-addition-by-fetching-urls",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"baseColumnName": "address",
"urlExpression": "grel:\"https://dev.virtualearth.net/REST/v1/Locations?q=\" + escape(value, \"url\") + \"&key=BingMapsKey\"",
"onError": "set-to-blank",
"newColumnName": "bing_json",
"columnInsertIndex": 1,
"delay": 0,
"cacheResponses": false,
"httpHeadersJson": null,
"description": "Create column bing_json at index 1 by fetching URLs based on column address using expression grel:\"https://dev.virtualearth.net/REST/v1/Locations?q=\" + escape(value, \"url\") + \"&key=BingMapsKey\""
},
{
"op": "core/column-addition",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"baseColumnName": "bing_json",
"expression": "grel:with(value.parseJson().resourceSets[0].resources[0].point.coordinates, pair, pair[0] +\", \" + pair[1])value",
"onError": "set-to-blank",
"newColumnName": "bing_lat_lon",
"columnInsertIndex": 2,
"description": "Create column bing_lat_lon at index 2 based on column bing_json using expression grel:with(value.parseJson().resourceSets[0].resources[0].point.coordinates, pair, pair[0] +\", \" + pair[1])value"
},
{
"op": "core/column-split",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"columnName": "bing_lat_lon",
"guessCellType": true,
"removeOriginalColumn": true,
"mode": "separator",
"separator": ",",
"regex": false,
"maxColumns": 0,
"description": "Split column bing_lat_lon by separator"
},
{
"op": "core/column-rename",
"oldColumnName": "bing_lat_lon 1",
"newColumnName": "bing_latitude",
"description": "Rename column bing_lat_lon 1 to bing_latitude"
},
{
"op": "core/column-rename",
"oldColumnName": "bing_lat_lon 2",
"newColumnName": "bing_longitude",
"description": "Rename column bing_lat_lon 2 to bing_longitude"
},
{
"op": "core/column-addition",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"baseColumnName": "bing_json",
"expression": "grel:with(value.parseJson().resourceSets[0].resources[0].confidence, v, v)",
"onError": "set-to-blank",
"newColumnName": "bing_confidence",
"columnInsertIndex": 2,
"description": "Create column bing_confidence at index 2 based on column bing_json using expression grel:with(value.parseJson().resourceSets[0].resources[0].confidence, v, v)"
},
{
"op": "core/column-addition",
"engineConfig": {
"facets": [],
"mode": "row-based"
},
"baseColumnName": "bing_json",
"expression": "grel:with(value.parseJson().resourceSets[0].resources[0].entityType, v, v)",
"onError": "set-to-blank",
"newColumnName": "bing_type",
"columnInsertIndex": 2,
"description": "Create column bing_type at index 2 based on column bing_json using expression grel:with(value.parseJson().resourceSets[0].resources[0].entityType, v, v)"
},
{
"op": "core/column-removal",
"columnName": "bing_json",
"description": "Remove column bing_json"
}
]