| 12 | == Americas == |
| 13 | |
| 14 | === Afghanistan === |
| 15 | Admin Boundaries: |
| 16 | * [http://eden.sahanafoundation.org/downloads/US_Lx.7z US_Lx.7z] |
| 17 | |
| 18 | These have come originally from [http://gadm.org GADM] |
| 19 | |
| 20 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| 21 | {{{ |
| 22 | cd /home/web2py |
| 23 | p7zip -d US_Lx.7z |
| 24 | python web2py.py -S eden -M |
| 25 | |
| 26 | auth.override = True |
| 27 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| 28 | resource = s3db.resource("gis_location") |
| 29 | filename = "US_L0.csv" |
| 30 | File = open(filename, "r") |
| 31 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 32 | db.commit() |
| 33 | filename = "US_L1.csv" |
| 34 | File = open(filename, "r") |
| 35 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 36 | db.commit() |
| 37 | filename = "US_L2.csv" |
| 38 | File = open(filename, "r") |
| 39 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 40 | db.commit() |
| 41 | gis.update_location_tree() |
| 42 | db.commit() |
| 43 | }}} |
| 44 | |