| 6 | |
| 7 | === Cambodia === |
| 8 | Admin Boundaries: |
| 9 | * [http://eden.sahanafoundation.org/downloads/KH_Lx.7z KH_Lx.7z] |
| 10 | |
| 11 | These have come originally from [http://gadm.org COD] with Khmer names, Hierarchy, Newer locations and better Romanised names from Wikipedia. |
| 12 | |
| 13 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| 14 | {{{ |
| 15 | cd /home/web2py |
| 16 | p7zip -d KH_Lx.7z |
| 17 | python web2py.py -S eden -M |
| 18 | |
| 19 | auth.override = True |
| 20 | settings.L10n.languages["km"] = "Khmer" |
| 21 | resource = s3db.resource("gis_location") |
| 22 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| 23 | import_file = "KH_L0.csv" |
| 24 | File = open(import_file, "r") |
| 25 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 26 | db.commit() |
| 27 | import_file = "KH_L1.csv" |
| 28 | File = open(import_file, "r") |
| 29 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 30 | db.commit() |
| 31 | import_file = "KH_L2.csv" |
| 32 | File = open(import_file, "r") |
| 33 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 34 | db.commit() |
| 35 | gis.update_location_tree() |
| 36 | db.commit() |
| 37 | }}} |