| 322 | === South Africa === |
| 323 | Admin Boundaries: |
| 324 | * [http://eden.sahanafoundation.org/downloads/ZA_Lx.7z ZA_Lx.7z] |
| 325 | |
| 326 | These have come originally from [https://data.humdata.org/dataset/south-africa-admin-level-1-boundaries HDX]. |
| 327 | |
| 328 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| 329 | {{{ |
| 330 | cd /home/web2py |
| 331 | p7zip -d ZA_Lx.7z |
| 332 | python web2py.py -S eden -M |
| 333 | |
| 334 | auth.override = True |
| 335 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| 336 | resource = s3db.resource("gis_location") |
| 337 | filename = "ZA_L0.csv" |
| 338 | File = open(filename, "r") |
| 339 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 340 | db.commit() |
| 341 | filename = "ZA_L1.csv" |
| 342 | File = open(filename, "r") |
| 343 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 344 | db.commit() |
| 345 | filename = "ZA_L2.csv" |
| 346 | File = open(filename, "r") |
| 347 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 348 | db.commit() |
| 349 | filename = "ZA_L3.csv" |
| 350 | File = open(filename, "r") |
| 351 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 352 | db.commit() |
| 353 | filename = "ZA_L4.csv" |
| 354 | File = open(filename, "r") |
| 355 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 356 | db.commit() |
| 357 | gis.update_location_tree() |
| 358 | db.commit() |
| 359 | }}} |