| 371 | File = open(filename, "r") |
| 372 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 373 | db.commit() |
| 374 | gis.update_location_tree() |
| 375 | db.commit() |
| 376 | }}} |
| 377 | |
| 378 | === Colombia === |
| 379 | Admin Boundaries: |
| 380 | * [http://eden.sahanafoundation.org/downloads/CO_Lx.7z CO_Lx.7z] |
| 381 | |
| 382 | Source is [https://data.humdata.org/dataset/colombia-administrative-boundaries-levels-0-3 HDX]. |
| 383 | |
| 384 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| 385 | {{{ |
| 386 | cd /home/web2py |
| 387 | p7zip -d CO_Lx.7z |
| 388 | python web2py.py -S eden -M |
| 389 | |
| 390 | auth.override = True |
| 391 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| 392 | resource = s3db.resource("gis_location") |
| 393 | filename = "CO_L0.csv" |
| 394 | File = open(filename, "r") |
| 395 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 396 | db.commit() |
| 397 | filename = "CO_L1.csv" |
| 398 | File = open(filename, "r") |
| 399 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 400 | db.commit() |
| 401 | filename = "CO_L2.csv" |