| | 695 | File = open(filename, "r") |
| | 696 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 697 | db.commit() |
| | 698 | gis.update_location_tree() |
| | 699 | db.commit() |
| | 700 | }}} |
| | 701 | |
| | 702 | === Panama === |
| | 703 | Admin Boundaries: |
| | 704 | * [http://eden.sahanafoundation.org/downloads/PA_Lx.7z PA_Lx.7z] |
| | 705 | |
| | 706 | Source is [http://gadm.org GADM] via [https://data.humdata.org/dataset/panama-administrative-level-0-1-2-and-3-boundaries HDX]. |
| | 707 | |
| | 708 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| | 709 | {{{ |
| | 710 | cd /home/web2py |
| | 711 | p7zip -d PA_Lx.7z |
| | 712 | python web2py.py -S eden -M |
| | 713 | |
| | 714 | auth.override = True |
| | 715 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| | 716 | resource = s3db.resource("gis_location") |
| | 717 | filename = "PA_L0.csv" |
| | 718 | File = open(filename, "r") |
| | 719 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 720 | db.commit() |
| | 721 | filename = "PA_L1.csv" |
| | 722 | File = open(filename, "r") |
| | 723 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 724 | db.commit() |
| | 725 | filename = "PA_L2.csv" |
| | 726 | File = open(filename, "r") |
| | 727 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 728 | db.commit() |
| | 729 | filename = "PA_L3.csv" |