| 167 | File = open(import_file, "r") |
| 168 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 169 | db.commit() |
| 170 | gis.update_location_tree() |
| 171 | db.commit() |
| 172 | }}} |
| 173 | |
| 174 | === Myanmar === |
| 175 | Admin Boundaries: |
| 176 | * [http://eden.sahanafoundation.org/downloads/MM_Lx.7z MM_Lx.7z] |
| 177 | |
| 178 | These have come originally from [https://cod.humanitarianresponse.info COD] |
| 179 | |
| 180 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| 181 | {{{ |
| 182 | cd /home/web2py |
| 183 | p7zip -d MM_Lx.7z |
| 184 | python web2py.py -S eden -M |
| 185 | |
| 186 | auth.override = True |
| 187 | resource = s3db.resource("gis_location") |
| 188 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| 189 | import_file = "MM_L0.csv" |
| 190 | File = open(import_file, "r") |
| 191 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 192 | db.commit() |
| 193 | import_file = "MM_L1.csv" |
| 194 | File = open(import_file, "r") |
| 195 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 196 | db.commit() |
| 197 | import_file = "MM_L2.csv" |
| 198 | File = open(import_file, "r") |
| 199 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 200 | db.commit() |
| 201 | import_file = "MM_L3.csv" |
| 202 | File = open(import_file, "r") |
| 203 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 204 | db.commit() |
| 205 | import_file = "MM_L4.csv" |
| 206 | File = open(import_file, "r") |
| 207 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 208 | db.commit() |
| 209 | import_file = "MM_L5.csv" |