| 136 | File = open(import_file, "r") |
| 137 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 138 | db.commit() |
| 139 | gis.update_location_tree() |
| 140 | db.commit() |
| 141 | }}} |
| 142 | |
| 143 | === Nepal === |
| 144 | Admin Boundaries: |
| 145 | * [http://eden.sahanafoundation.org/downloads/NP_Lx.7z NP_Lx.7z] |
| 146 | |
| 147 | These have come originally from [http://gadm.org GADM] |
| 148 | |
| 149 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| 150 | {{{ |
| 151 | cd /home/web2py |
| 152 | p7zip -d NP_Lx.7z |
| 153 | python web2py.py -S eden -M |
| 154 | |
| 155 | auth.override = True |
| 156 | resource = s3db.resource("gis_location") |
| 157 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| 158 | import_file = "NP_L0.csv" |
| 159 | File = open(import_file, "r") |
| 160 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 161 | db.commit() |
| 162 | import_file = "NP_L1.csv" |
| 163 | File = open(import_file, "r") |
| 164 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 165 | db.commit() |
| 166 | import_file = "NP_L2.csv" |
| 167 | File = open(import_file, "r") |
| 168 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 169 | db.commit() |
| 170 | import_file = "NP_L3.csv" |
| 171 | File = open(import_file, "r") |
| 172 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 173 | db.commit() |
| 174 | import_file = "NP_L4.csv" |