| 136 | File = open(import_file, "r") |
| 137 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 138 | db.commit() |
| 139 | gis.update_location_tree() |
| 140 | db.commit() |
| 141 | }}} |
| 142 | |
| 143 | === Malaysia === |
| 144 | Admin Boundaries: |
| 145 | * [http://eden.sahanafoundation.org/downloads/MY_Lx.7z MY_Lx.7z] |
| 146 | |
| 147 | These have come originally from [http://gadm.org GADM] |
| 148 | |
| 149 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| 150 | {{{ |
| 151 | cd /home/web2py |
| 152 | p7zip -d MY_Lx.7z |
| 153 | python web2py.py -S eden -M |
| 154 | |
| 155 | auth.override = True |
| 156 | resource = s3db.resource("gis_location") |
| 157 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| 158 | import_file = "MY_L0.csv" |
| 159 | File = open(import_file, "r") |
| 160 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 161 | db.commit() |
| 162 | import_file = "MY_L1.csv" |
| 163 | File = open(import_file, "r") |
| 164 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 165 | db.commit() |
| 166 | import_file = "MY_L2.csv" |