Skip to content

Commit 202a5ef

Browse files
committed
docs
1 parent d0af13e commit 202a5ef

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,26 @@ The above command will generate a list of missing districts in the database base
213213
* `--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.
214214
* `--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.
215215

216+
## import-admin2-data
217+
This management command is used for updating and importing admin2 shapefile. To run:
218+
* `python manage.py import-admin2-data <filename.shp>`
219+
220+
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+
216236
## Update bbox for regions
217237
Run `python manage.py update-region-bbox` to update the bbox for each region in the database.
218238

0 commit comments

Comments
 (0)