| 999 | File = open(import_file, "r") |
| 1000 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 1001 | db.commit() |
| 1002 | gis.update_location_tree() |
| 1003 | db.commit() |
| 1004 | }}} |
| 1005 | |
| 1006 | === Bhutan === |
| 1007 | Admin Boundaries: |
| 1008 | * [http://eden.sahanafoundation.org/downloads/BT_Lx.7z BT_Lx.7z] |
| 1009 | |
| 1010 | These have come originally from [https://data.humdata.org/dataset/bhutan-administrative-boundaries-levels-0-2 HDX] with Dzongkha names and alternate names from Wikipedia.[[BR]] |
| 1011 | |
| 1012 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| 1013 | {{{ |
| 1014 | cd /home/web2py |
| 1015 | p7zip -d BT_Lx.7z |
| 1016 | python web2py.py -S eden -M |
| 1017 | |
| 1018 | auth.override = True |
| 1019 | languages = s3.l10n_languages |
| 1020 | languages["dz"] = "Dzongkha" |
| 1021 | resource = s3db.resource("gis_location") |
| 1022 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| 1023 | import_file = "BT_L0.csv" |
| 1024 | File = open(import_file, "r") |
| 1025 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 1026 | db.commit() |
| 1027 | import_file = "BT_L1.csv" |
| 1028 | File = open(import_file, "r") |
| 1029 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 1030 | db.commit() |
| 1031 | import_file = "BT_L2.csv" |