Skip to content

Commit 00d801c

Browse files
committed
updates for adding column to grid maps
1 parent 90806b5 commit 00d801c

File tree

2 files changed

+121
-0
lines changed

2 files changed

+121
-0
lines changed

FastGeospatial.postman_collection.json

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,111 @@
6565
}
6666
},
6767
"response": []
68+
},
69+
{
70+
"name": "Dissolve",
71+
"request": {
72+
"method": "POST",
73+
"header": [],
74+
"body": {
75+
"mode": "raw",
76+
"raw": "{\n \"table\": \"states\",\n \"database\": \"data\"\n}",
77+
"options": {
78+
"raw": {
79+
"language": "json"
80+
}
81+
}
82+
},
83+
"url": {
84+
"raw": "http://127.0.0.1:8000/api/v1/analysis/dissolve/",
85+
"protocol": "http",
86+
"host": [
87+
"127",
88+
"0",
89+
"0",
90+
"1"
91+
],
92+
"port": "8000",
93+
"path": [
94+
"api",
95+
"v1",
96+
"analysis",
97+
"dissolve",
98+
""
99+
]
100+
}
101+
},
102+
"response": []
103+
},
104+
{
105+
"name": "Dissolve By Value",
106+
"request": {
107+
"method": "POST",
108+
"header": [],
109+
"body": {
110+
"mode": "raw",
111+
"raw": "{\n \"table\": \"states\",\n \"database\": \"data\",\n \"column\": \"sub_region\"\n}",
112+
"options": {
113+
"raw": {
114+
"language": "json"
115+
}
116+
}
117+
},
118+
"url": {
119+
"raw": "http://127.0.0.1:8000/api/v1/analysis/dissolve_by_value/",
120+
"protocol": "http",
121+
"host": [
122+
"127",
123+
"0",
124+
"0",
125+
"1"
126+
],
127+
"port": "8000",
128+
"path": [
129+
"api",
130+
"v1",
131+
"analysis",
132+
"dissolve_by_value",
133+
""
134+
]
135+
}
136+
},
137+
"response": []
138+
},
139+
{
140+
"name": "Square Grids",
141+
"request": {
142+
"method": "POST",
143+
"header": [],
144+
"body": {
145+
"mode": "raw",
146+
"raw": "{\n \"table\": \"states\",\n \"database\": \"data\",\n \"grid_size_in_kilometers\": \"100\"\n}",
147+
"options": {
148+
"raw": {
149+
"language": "json"
150+
}
151+
}
152+
},
153+
"url": {
154+
"raw": "http://127.0.0.1:8000/api/v1/analysis/square_grids/",
155+
"protocol": "http",
156+
"host": [
157+
"127",
158+
"0",
159+
"0",
160+
"1"
161+
],
162+
"port": "8000",
163+
"path": [
164+
"api",
165+
"v1",
166+
"analysis",
167+
"square_grids",
168+
""
169+
]
170+
}
171+
},
172+
"response": []
68173
}
69174
]
70175
}

analysis_queries.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ async def square_grids(table: str, database: str, new_table_id: str, grid_size_i
131131

132132
await con.fetch(sql__query)
133133

134+
size_column_query = f"""
135+
ALTER TABLE {new_table_id}
136+
ADD COLUMN grid_size_in_kilometers float NOT NULL
137+
DEFAULT {grid_size_in_kilometers};
138+
"""
139+
140+
await con.fetch(size_column_query)
141+
134142
analysis.analysis_processes[process_id]['status'] = "SUCCESS"
135143
analysis.analysis_processes[process_id]['new_table_id'] = new_table_id
136144
analysis.analysis_processes[process_id]['completion_time'] = datetime.datetime.now()
@@ -161,6 +169,14 @@ async def hexagon_grids(table: str, database: str, new_table_id: str, grid_size_
161169

162170
await con.fetch(sql__query)
163171

172+
size_column_query = f"""
173+
ALTER TABLE {new_table_id}
174+
ADD COLUMN grid_size_in_kilometers float NOT NULL
175+
DEFAULT {grid_size_in_kilometers};
176+
"""
177+
178+
await con.fetch(size_column_query)
179+
164180
analysis.analysis_processes[process_id]['status'] = "SUCCESS"
165181
analysis.analysis_processes[process_id]['new_table_id'] = new_table_id
166182
analysis.analysis_processes[process_id]['completion_time'] = datetime.datetime.now()

0 commit comments

Comments
 (0)