| | 41 | |
| | 42 | === Philippines === |
| | 43 | Admin Boundaries: |
| | 44 | * [http://eden.sahanafoundation.org/downloads/PH_Lx.7z PH_Lx.7z] |
| | 45 | |
| | 46 | These have come originally from [http://gadm.org GADM] but have had L1s inserted by [http://www.philgis.org/freegisdata.htm PhilGIS] so their L1s become L2s, etc |
| | 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 PH_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 = "PH_L0.csv" |
| | 58 | File = open(import_file, "r") |
| | 59 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 60 | db.commit() |
| | 61 | import_file = "PH_L1.csv" |
| | 62 | File = open(import_file, "r") |
| | 63 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 64 | db.commit() |
| | 65 | import_file = "PH_L2.csv" |
| | 66 | File = open(import_file, "r") |
| | 67 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 68 | db.commit() |
| | 69 | import_file = "PH_L3.csv" |
| | 70 | File = open(import_file, "r") |
| | 71 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 72 | db.commit() |
| | 73 | import_file = "PH_L4.csv" |
| | 74 | File = open(import_file, "r") |
| | 75 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 76 | db.commit() |
| | 77 | gis.update_location_tree() |
| | 78 | db.commit() |
| | 79 | }}} |
| | 80 | |