| 464 | File = open(filename, "r") |
| 465 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 466 | db.commit() |
| 467 | gis.update_location_tree() |
| 468 | db.commit() |
| 469 | }}} |
| 470 | |
| 471 | === Dominican Republic === |
| 472 | Admin Boundaries: |
| 473 | * [http://eden.sahanafoundation.org/downloads/DO_Lx.7z DO_Lx.7z] |
| 474 | |
| 475 | Source is [https://www.one.gob.do/cartografia/281/shapefiles Oficina Nacional de EstadÃstica] via [https://data.humdata.org/dataset/dominican-republic-administrative-boundaries-levels-0-6 HDX]. |
| 476 | |
| 477 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| 478 | {{{ |
| 479 | cd /home/web2py |
| 480 | p7zip -d DO_Lx.7z |
| 481 | python web2py.py -S eden -M |
| 482 | |
| 483 | auth.override = True |
| 484 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| 485 | resource = s3db.resource("gis_location") |
| 486 | filename = "DO_L0.csv" |
| 487 | File = open(filename, "r") |
| 488 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 489 | db.commit() |
| 490 | filename = "DO_L1.csv" |
| 491 | File = open(filename, "r") |
| 492 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 493 | db.commit() |
| 494 | filename = "DO_L2.csv" |
| 495 | File = open(filename, "r") |
| 496 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 497 | db.commit() |
| 498 | filename = "DO_L3.csv" |
| 499 | File = open(filename, "r") |
| 500 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 501 | db.commit() |
| 502 | filename = "DO_L4.csv" |
| 503 | File = open(filename, "r") |
| 504 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 505 | db.commit() |
| 506 | filename = "DO_L5.csv" |