| 201 | File = open(filename, "r") |
| 202 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 203 | db.commit() |
| 204 | gis.update_location_tree() |
| 205 | db.commit() |
| 206 | }}} |
| 207 | |
| 208 | === Seychelles === |
| 209 | Admin Boundaries: |
| 210 | * [http://eden.sahanafoundation.org/downloads/SC_Lx.7z SC_Lx.7z] |
| 211 | |
| 212 | The L0 / L1 polygons have come originally from [http://gadm.org GADM] including HASC codes. Creole names and L2 / L3 hierarchy came from Wikipedia. |
| 213 | |
| 214 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| 215 | {{{ |
| 216 | cd /home/web2py |
| 217 | p7zip -d SC_Lx.7z |
| 218 | python web2py.py -S eden -M |
| 219 | |
| 220 | auth.override = True |
| 221 | languages = s3.l10n_languages |
| 222 | languages["fr"] = "French" |
| 223 | languages["crs"] = "Seychellois Creole" |
| 224 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| 225 | resource = s3db.resource("gis_location") |
| 226 | filename = "SC_L0.csv" |
| 227 | File = open(filename, "r") |
| 228 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 229 | db.commit() |
| 230 | filename = "SC_L1.csv" |
| 231 | File = open(filename, "r") |
| 232 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 233 | db.commit() |
| 234 | filename = "SC_L2.csv" |
| 235 | File = open(filename, "r") |
| 236 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 237 | db.commit() |
| 238 | filename = "SC_L3.csv" |