| 402 | File = open(filename, "r") |
| 403 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 404 | db.commit() |
| 405 | gis.update_location_tree() |
| 406 | db.commit() |
| 407 | }}} |
| 408 | |
| 409 | === Costa Rica === |
| 410 | Admin Boundaries: |
| 411 | * [http://eden.sahanafoundation.org/downloads/CR_Lx.7z CR_Lx.7z] |
| 412 | |
| 413 | Source is [http://gadm.org GADM]. |
| 414 | |
| 415 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| 416 | {{{ |
| 417 | cd /home/web2py |
| 418 | p7zip -d CR_Lx.7z |
| 419 | python web2py.py -S eden -M |
| 420 | |
| 421 | auth.override = True |
| 422 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| 423 | resource = s3db.resource("gis_location") |
| 424 | filename = "CR_L0.csv" |
| 425 | File = open(filename, "r") |
| 426 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 427 | db.commit() |
| 428 | filename = "CR_L1.csv" |
| 429 | File = open(filename, "r") |
| 430 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| 431 | db.commit() |
| 432 | filename = "CR_L2.csv" |