You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20Lines changed: 20 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -213,6 +213,26 @@ The above command will generate a list of missing districts in the database base
213
213
*`--import-missing missing-districts.txt` -- this will import districts for the iso2 mentioned in `missing-districts.txt` to the database. The file is the same format as generated by the default command.
214
214
*`--import-all` -- this option is used to import all districts in the shapefile, if they don't have a code we can match against in the database.
215
215
216
+
## import-admin2-data
217
+
This management command is used for updating and importing admin2 shapefile. To run:
The shapefile should have the following mandatory fields:
221
+
* name or shapeName
222
+
* code or pcode
223
+
* admin1_id (this is the ID of the GO district this admin2 belongs to)
224
+
225
+
See [this ticket](https://github.com/IFRCGo/go-api/issues/1492#issuecomment-1284120696) for a full workflow of preparing the admin2 shapefiles.
226
+
The above command will generate a list of missing admin2s in the database based on the code (we use pcodes) to a file called `missing-admin2.txt`
227
+
228
+
### Options available for the command
229
+
*`--update-geom` -- updates the geometry for all admin2 matched in the shapefile.
230
+
*`--update-bbox` -- updates the bbox for all admin2 matched in the shapefile.
231
+
*`--update-centroid` -- updates the centroid for all admin2 matched in the shapefile.
232
+
*`--import-missing missing-admin2.txt` -- this will import admin2 listed in `missing-districts.txt` to the database. The file is the same format as generated by the default command.
233
+
*`--import-all` -- this option is used to import all admin2 in the shapefile.
234
+
235
+
216
236
## Update bbox for regions
217
237
Run `python manage.py update-region-bbox` to update the bbox for each region in the database.
0 commit comments