| | 47 | gis.update_location_tree() |
| | 48 | db.commit() |
| | 49 | }}} |
| | 50 | |
| | 51 | === Liberia === |
| | 52 | Admin Boundaries: |
| | 53 | * [http://eden.sahanafoundation.org/downloads/LR_Lx.7z LR_Lx.7z] |
| | 54 | |
| | 55 | These have come originally from [http://gadm.org GADM] for !L0/L1 and [http://cod.humanitarianresponse.info COD] for L2...adding PCodes & UNMIL 'Health' codes. |
| | 56 | |
| | 57 | NB L3 is included (data from GADM), but not recommended to import as it will add several L2s which no longer exist. |
| | 58 | |
| | 59 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| | 60 | {{{ |
| | 61 | cd /home/web2py |
| | 62 | p7zip -d LR_Lx.7z |
| | 63 | python web2py.py -S eden -M |
| | 64 | |
| | 65 | auth.override = True |
| | 66 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| | 67 | resource = s3db.resource("gis_location") |
| | 68 | filename = "LR_L0.csv" |
| | 69 | File = open(filename, "r") |
| | 70 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 71 | db.commit() |
| | 72 | filename = "LR_L1.csv" |
| | 73 | File = open(filename, "r") |
| | 74 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 75 | db.commit() |
| | 76 | filename = "LR_L2.csv" |
| | 77 | File = open(filename, "r") |
| | 78 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 79 | db.commit() |
| | 80 | #filename = "LR_L3.csv" |
| | 81 | #File = open(filename, "r") |
| | 82 | #resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 83 | #db.commit() |