| | 342 | |
| | 343 | === Chile === |
| | 344 | Admin Boundaries: |
| | 345 | * [http://eden.sahanafoundation.org/downloads/CL_Lx.7z CL_Lx.7z] |
| | 346 | |
| | 347 | Source for Polygons is [http://gadm.org GADM] via [https://data.humdata.org/dataset/chile-administrative-level-0-country-1-region-region HDX]. |
| | 348 | |
| | 349 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| | 350 | {{{ |
| | 351 | cd /home/web2py |
| | 352 | p7zip -d CL_Lx.7z |
| | 353 | python web2py.py -S eden -M |
| | 354 | |
| | 355 | auth.override = True |
| | 356 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| | 357 | resource = s3db.resource("gis_location") |
| | 358 | filename = "CL_L0.csv" |
| | 359 | File = open(filename, "r") |
| | 360 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 361 | db.commit() |
| | 362 | filename = "CL_L1.csv" |
| | 363 | File = open(filename, "r") |
| | 364 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 365 | db.commit() |
| | 366 | filename = "CL_L2.csv" |
| | 367 | File = open(filename, "r") |
| | 368 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 369 | db.commit() |
| | 370 | filename = "CL_L3.csv" |
| | 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 | }}} |