| 35 | File = open(import_file, "r") |
| 36 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 37 | db.commit() |
| 38 | gis.update_location_tree() |
| 39 | db.commit() |
| 40 | }}} |
| 41 | |
| 42 | === Indonesia === |
| 43 | Admin Boundaries: |
| 44 | * [http://eden.sahanafoundation.org/downloads/ID_Lx.7z ID_Lx.7z] |
| 45 | |
| 46 | These have come originally from [http://gadm.org GADM] |
| 47 | |
| 48 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| 49 | {{{ |
| 50 | cd /home/web2py |
| 51 | p7zip -d ID_Lx.7z |
| 52 | python web2py.py -S eden -M |
| 53 | |
| 54 | auth.override = True |
| 55 | resource = s3db.resource("gis_location") |
| 56 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| 57 | import_file = "ID_L0.csv" |
| 58 | File = open(import_file, "r") |
| 59 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 60 | db.commit() |
| 61 | import_file = "ID_L1.csv" |
| 62 | File = open(import_file, "r") |
| 63 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 64 | db.commit() |
| 65 | import_file = "ID_L2.csv" |