| | 53 | File = open(filename, "r") |
| | 54 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 55 | db.commit() |
| | 56 | gis.update_location_tree() |
| | 57 | db.commit() |
| | 58 | }}} |
| | 59 | |
| | 60 | === Democratic Republic of Congo === |
| | 61 | Admin Boundaries: |
| | 62 | * [http://eden.sahanafoundation.org/downloads/CD_Lx.7z CD_Lx.7z] |
| | 63 | |
| | 64 | These have come originally from [https://data.humdata.org/dataset/drc-administrative-boundaries-levels-0-2 HDX]. |
| | 65 | |
| | 66 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| | 67 | {{{ |
| | 68 | cd /home/web2py |
| | 69 | p7zip -d CD_Lx.7z |
| | 70 | python web2py.py -S eden -M |
| | 71 | |
| | 72 | auth.override = True |
| | 73 | languages = s3.l10n_languages |
| | 74 | languages["fr"] = "French" |
| | 75 | languages["kg"] = "Kongo" |
| | 76 | languages["ln"] = "Lingala" |
| | 77 | languages["sw"] = "Swahili" |
| | 78 | languages["lu"] = "Luba-Katanga" |
| | 79 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| | 80 | resource = s3db.resource("gis_location") |
| | 81 | filename = "CD_L0.csv" |
| | 82 | File = open(filename, "r") |
| | 83 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 84 | db.commit() |
| | 85 | filename = "CD_L1.csv" |
| | 86 | File = open(filename, "r") |
| | 87 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 88 | db.commit() |
| | 89 | filename = "CD_L2.csv" |