| 12 | |
| 13 | === Afghanistan === |
| 14 | Admin Boundaries: |
| 15 | * [http://eden.sahanafoundation.org/downloads/AF_Lx.7z AF_Lx.7z] |
| 16 | |
| 17 | These have come originally from [https://cod.humanitarianresponse.info COD] with Dari/Pashto names and better Romanised names from Wikipedia.[[BR]] |
| 18 | |
| 19 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| 20 | {{{ |
| 21 | cd /home/web2py |
| 22 | p7zip -d AF_Lx.7z |
| 23 | python web2py.py -S eden -M |
| 24 | |
| 25 | auth.override = True |
| 26 | settings.L10n.languages["prs"] = "Dari" |
| 27 | settings.L10n.languages["ps"] = "Pashto" |
| 28 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| 29 | resource = s3db.resource("gis_location") |
| 30 | filename = "AF_L0.csv" |
| 31 | File = open(filename, "r") |
| 32 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 33 | db.commit() |
| 34 | filename = "AF_L1.csv" |
| 35 | File = open(filename, "r") |
| 36 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 37 | db.commit() |
| 38 | filename = "AF_L2.csv" |
| 39 | File = open(filename, "r") |
| 40 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 41 | db.commit() |
| 42 | gis.update_location_tree() |
| 43 | db.commit() |
| 44 | }}} |