| 530 | File = open(filename, "r") |
| 531 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 532 | db.commit() |
| 533 | gis.update_location_tree() |
| 534 | db.commit() |
| 535 | }}} |
| 536 | |
| 537 | === Guatemala === |
| 538 | Admin Boundaries: |
| 539 | * [http://eden.sahanafoundation.org/downloads/GT_Lx.7z GT_Lx.7z] |
| 540 | |
| 541 | Source is [http://gadm.org GADM] via [https://data.humdata.org/dataset/guatemala-administrative-level-0-national-1-departments-and-2-municipalities HDX]. |
| 542 | |
| 543 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| 544 | {{{ |
| 545 | cd /home/web2py |
| 546 | p7zip -d GT_Lx.7z |
| 547 | python web2py.py -S eden -M |
| 548 | |
| 549 | auth.override = True |
| 550 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| 551 | resource = s3db.resource("gis_location") |
| 552 | filename = "GT_L0.csv" |
| 553 | File = open(filename, "r") |
| 554 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 555 | db.commit() |
| 556 | filename = "GT_L1.csv" |
| 557 | File = open(filename, "r") |
| 558 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 559 | db.commit() |
| 560 | filename = "GT_L2.csv" |