| | 764 | File = open(filename, "r") |
| | 765 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 766 | db.commit() |
| | 767 | gis.update_location_tree() |
| | 768 | db.commit() |
| | 769 | }}} |
| | 770 | |
| | 771 | === Peru === |
| | 772 | Admin Boundaries: |
| | 773 | * [http://eden.sahanafoundation.org/downloads/PE_Lx.7z PE_Lx.7z] |
| | 774 | |
| | 775 | Source is Instituto Geográfico Nacional (IGN) via [https://data.humdata.org/dataset/limites-de-peru HDX] |
| | 776 | |
| | 777 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| | 778 | {{{ |
| | 779 | cd /home/web2py |
| | 780 | p7zip -d PE_Lx.7z |
| | 781 | python web2py.py -S eden -M |
| | 782 | |
| | 783 | auth.override = True |
| | 784 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| | 785 | resource = s3db.resource("gis_location") |
| | 786 | filename = "PE_L0.csv" |
| | 787 | File = open(filename, "r") |
| | 788 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 789 | db.commit() |
| | 790 | filename = "PE_L1.csv" |
| | 791 | File = open(filename, "r") |
| | 792 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 793 | db.commit() |
| | 794 | filename = "PE_L2.csv" |