| | 944 | === Singapore === |
| | 945 | Admin Boundaries: |
| | 946 | * [http://eden.sahanafoundation.org/downloads/SG_Lx.7z SG_Lx.7z] |
| | 947 | |
| | 948 | These have come originally from [http://gadm.org GADM]. |
| | 949 | |
| | 950 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| | 951 | {{{ |
| | 952 | cd /home/web2py |
| | 953 | p7zip -d SG_Lx.7z |
| | 954 | python web2py.py -S eden -M |
| | 955 | |
| | 956 | auth.override = True |
| | 957 | resource = s3db.resource("gis_location") |
| | 958 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| | 959 | import_file = "SG_L0.csv" |
| | 960 | File = open(import_file, "r") |
| | 961 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 962 | db.commit() |
| | 963 | import_file = "SG_L1.csv" |
| | 964 | File = open(import_file, "r") |
| | 965 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 966 | db.commit() |
| | 967 | gis.update_location_tree() |
| | 968 | db.commit() |
| | 969 | }}} |
| | 970 | |