| | 433 | File = open(filename, "r") |
| | 434 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 435 | db.commit() |
| | 436 | gis.update_location_tree() |
| | 437 | db.commit() |
| | 438 | }}} |
| | 439 | |
| | 440 | === Cuba === |
| | 441 | Admin Boundaries: |
| | 442 | * [http://eden.sahanafoundation.org/downloads/CU_Lx.7z CU_Lx.7z] |
| | 443 | |
| | 444 | Source is [http://gadm.org GADM] via [https://data.humdata.org/dataset/cuba-administrative-boundaries-levels-0-and-1-from-gadm HDX]. |
| | 445 | |
| | 446 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| | 447 | {{{ |
| | 448 | cd /home/web2py |
| | 449 | p7zip -d CU_Lx.7z |
| | 450 | python web2py.py -S eden -M |
| | 451 | |
| | 452 | auth.override = True |
| | 453 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| | 454 | resource = s3db.resource("gis_location") |
| | 455 | filename = "CU_L0.csv" |
| | 456 | File = open(filename, "r") |
| | 457 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 458 | db.commit() |
| | 459 | filename = "CU_L1.csv" |
| | 460 | File = open(filename, "r") |
| | 461 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 462 | db.commit() |
| | 463 | filename = "CU_L2.csv" |