| 631 | File = open(filename, "r") |
| 632 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 633 | db.commit() |
| 634 | gis.update_location_tree() |
| 635 | db.commit() |
| 636 | }}} |
| 637 | |
| 638 | === Mexico === |
| 639 | Admin Boundaries: |
| 640 | * [http://eden.sahanafoundation.org/downloads/MX_Lx.7z MX_Lx.7z] |
| 641 | |
| 642 | Source is [http://gadm.org GADM] via [https://data.humdata.org/dataset/mexico-administrative-level-0-national-1-state-and-mexico-city-and-2-boundaries HDX] |
| 643 | |
| 644 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| 645 | {{{ |
| 646 | cd /home/web2py |
| 647 | p7zip -d MX_Lx.7z |
| 648 | python web2py.py -S eden -M |
| 649 | |
| 650 | auth.override = True |
| 651 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| 652 | resource = s3db.resource("gis_location") |
| 653 | filename = "MX_L0.csv" |
| 654 | File = open(filename, "r") |
| 655 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 656 | db.commit() |
| 657 | filename = "MX_L1.csv" |
| 658 | File = open(filename, "r") |
| 659 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 660 | db.commit() |
| 661 | filename = "MX_L2.csv" |