| | 846 | == Oceania == |
| | 847 | === Papua New Guinea === |
| | 848 | Admin Boundaries: |
| | 849 | * [http://eden.sahanafoundation.org/downloads/PG_Lx.7z PG_Lx.7z] |
| | 850 | |
| | 851 | These have come originally from [http://gadm.org GADM] with L3 & L4 added from Wikipedia. |
| | 852 | |
| | 853 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| | 854 | {{{ |
| | 855 | cd /home/web2py |
| | 856 | p7zip -d PG_Lx.7z |
| | 857 | python web2py.py -S eden -M |
| | 858 | |
| | 859 | auth.override = True |
| | 860 | settings.L10n.languages["tpi"] = "Tok Pisin" |
| | 861 | settings.L10n.languages["ho"] = "Hiri Motu" |
| | 862 | resource = s3db.resource("gis_location") |
| | 863 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| | 864 | import_file = "PG_L0.csv" |
| | 865 | File = open(import_file, "r") |
| | 866 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 867 | db.commit() |
| | 868 | import_file = "PG_L1.csv" |
| | 869 | File = open(import_file, "r") |
| | 870 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 871 | db.commit() |
| | 872 | import_file = "PG_L2.csv" |
| | 873 | File = open(import_file, "r") |
| | 874 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 875 | db.commit() |
| | 876 | filename = "PG_L3.csv" |
| | 877 | File = open(filename, "r") |
| | 878 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 879 | db.commit() |
| | 880 | filename = "PG_L4.csv" |
| | 881 | File = open(filename, "r") |
| | 882 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 883 | db.commit() |
| | 884 | gis.update_location_tree() |
| | 885 | db.commit() |
| | 886 | }}} |
| | 887 | |