| | 495 | File = open(filename, "r") |
| | 496 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 497 | db.commit() |
| | 498 | gis.update_location_tree() |
| | 499 | db.commit() |
| | 500 | }}} |
| | 501 | |
| | 502 | === Ecuador === |
| | 503 | Admin Boundaries: |
| | 504 | * [http://eden.sahanafoundation.org/downloads/EC_Lx.7z EC_Lx.7z] |
| | 505 | |
| | 506 | Source is [http://gadm.org GADM] since the [https://data.humdata.org/dataset/ecuador-admin-level-1-boundaries HDX] version is based on an older export and is harder to use. |
| | 507 | |
| | 508 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| | 509 | {{{ |
| | 510 | cd /home/web2py |
| | 511 | p7zip -d EC_Lx.7z |
| | 512 | python web2py.py -S eden -M |
| | 513 | |
| | 514 | auth.override = True |
| | 515 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| | 516 | resource = s3db.resource("gis_location") |
| | 517 | filename = "EC_L0.csv" |
| | 518 | File = open(filename, "r") |
| | 519 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 520 | db.commit() |
| | 521 | filename = "EC_L1.csv" |
| | 522 | File = open(filename, "r") |
| | 523 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 524 | db.commit() |
| | 525 | filename = "EC_L2.csv" |
| | 526 | File = open(filename, "r") |
| | 527 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 528 | db.commit() |
| | 529 | filename = "EC_L3.csv" |