| 424 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 425 | db.commit() |
| 426 | gis.update_location_tree() |
| 427 | db.commit() |
| 428 | }}} |
| 429 | |
| 430 | === Sri Lanka === |
| 431 | Admin Boundaries: |
| 432 | * [http://eden.sahanafoundation.org/downloads/SL_Lx.7z SL_Lx.7z] |
| 433 | |
| 434 | These have come originally from [http://cod.humanitarianresponse.info COD] with Sinhala & Tamil names added from Wikipedia. |
| 435 | |
| 436 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| 437 | {{{ |
| 438 | cd /home/web2py |
| 439 | p7zip -d SL_Lx.7z |
| 440 | python web2py.py -S eden -M |
| 441 | |
| 442 | auth.override = True |
| 443 | languages = s3.l10n_languages |
| 444 | languages["si"] = "Sinhala" |
| 445 | languages["ta"] = "Tamil" |
| 446 | resource = s3db.resource("gis_location") |
| 447 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| 448 | import_file = "SL_L1.csv" |
| 449 | File = open(import_file, "r") |
| 450 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 451 | db.commit() |
| 452 | filename = "SL_L2.csv" |
| 453 | File = open(filename, "r") |
| 454 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 455 | db.commit() |
| 456 | filename = "SL_L3.csv" |
| 457 | File = open(filename, "r") |
| 458 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 459 | db.commit() |
| 460 | filename = "SL_L4.csv" |
| 461 | File = open(filename, "r") |