| | 130 | gis.update_location_tree() |
| | 131 | db.commit() |
| | 132 | }}} |
| | 133 | |
| | 134 | === Madagascar === |
| | 135 | Admin Boundaries: |
| | 136 | * [http://eden.sahanafoundation.org/downloads/MG_Lx.7z MG_Lx.7z] |
| | 137 | |
| | 138 | These have come originally from [http://cod.humanitarianresponse.info COD] with L0 & alternate names fronm [http://gadm.org GADM]. |
| | 139 | |
| | 140 | Use [http://7zip.org 7-Zip] to extract to your web2py folder & then install like this: |
| | 141 | {{{ |
| | 142 | cd /home/web2py |
| | 143 | p7zip -d MG_Lx.7z |
| | 144 | python web2py.py -S eden -M |
| | 145 | |
| | 146 | auth.override = True |
| | 147 | languages = s3.l10n_languages |
| | 148 | languages["mg"] = "Malagasy" |
| | 149 | stylesheet = os.path.join(request.folder, "static", "formats", "s3csv", "gis", "location.xsl") |
| | 150 | resource = s3db.resource("gis_location") |
| | 151 | filename = "MG_L0.csv" |
| | 152 | File = open(filename, "r") |
| | 153 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 154 | db.commit() |
| | 155 | filename = "MG_L1.csv" |
| | 156 | File = open(filename, "r") |
| | 157 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 158 | db.commit() |
| | 159 | filename = "MG_L2.csv" |
| | 160 | File = open(filename, "r") |
| | 161 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 162 | db.commit() |
| | 163 | filename = "MG_L3.csv" |
| | 164 | File = open(filename, "r") |
| | 165 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 166 | db.commit() |
| | 167 | filename = "MG_L4.csv" |
| | 168 | File = open(filename, "r") |
| | 169 | resource.import_xml(File, format="csv", stylesheet=stylesheet) |
| | 170 | db.commit() |