Skip to content

Commit 6402812

Browse files
Merge pull request #1578 from IFRCGo/fix-docs
Admin2 tile fixes
2 parents 93b2307 + 54d4293 commit 6402812

File tree

14 files changed

+138
-5
lines changed

14 files changed

+138
-5
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,7 @@ The above command will generate a list of missing admin2s in the database based
229229

230230
### Options available for the command
231231
* `--update-geom` -- updates the geometry for all admin2 matched in the shapefile.
232-
* `--update-bbox` -- updates the bbox for all admin2 matched in the shapefile.
233-
* `--update-centroid` -- updates the centroid for all admin2 matched in the shapefile.
234-
* `--import-missing missing-admin2.txt` -- this will import admin2 listed in `missing-districts.txt` to the database. The file is the same format as generated by the default command.
232+
* `--import-missing missing-admin2.txt` -- this will import admin2 listed in `missing-admin2.txt` to the database. The file is the same format as generated by the default command.
235233
* `--import-all` -- this option is used to import all admin2 in the shapefile.
236234

237235

api/management/commands/update-mapbox-tilesets.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def handle(self, *args, **options):
6969

7070
if options['update_admin2']:
7171
print(f'Updating tileset for {options["update_admin2"]}')
72-
self.update_admin2(options['update_admin2'], staging)
72+
self.publish_admin2(options['update_admin2'], staging, False)
7373

7474
except BaseException as e:
7575
raise CommandError('Could not update tilesets: ' + str(e))
@@ -224,7 +224,10 @@ def update_admin2(self, iso, staging=True):
224224
if not staging:
225225
tileset_source__name = f'go-admin2-{iso}-src'
226226

227-
status = subprocess.run(['tilesets', 'upload-source', '--replace', 'go-ifrc', tileset_source__name, f'/tmp/{iso}.geojson'])
227+
print('Tileset source', tileset_source__name)
228+
status = self.prepare_admin2_geojson(iso)
229+
if status:
230+
status = subprocess.run(['tilesets', 'upload-source', '--replace', 'go-ifrc', tileset_source__name, f'/tmp/{iso}.geojson'])
228231
return True if status.returncode == 0 else False
229232

230233
def publish_admin2(self, iso, staging=True, create=False):

mapbox/admin2/GTM-staging.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": 1,
3+
"layers": {
4+
"go-admin2-GTM-staging": {
5+
"source": "mapbox://tileset-source/go-ifrc/go-admin2-GTM-src-staging",
6+
"minzoom": 10,
7+
"maxzoom": 14
8+
}
9+
}
10+
}
11+

mapbox/admin2/GTM.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": 1,
3+
"layers": {
4+
"go-admin2-GTM": {
5+
"source": "mapbox://tileset-source/go-ifrc/go-admin2-GTM-src",
6+
"minzoom": 10,
7+
"maxzoom": 14
8+
}
9+
}
10+
}
11+

mapbox/admin2/HND-staging.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": 1,
3+
"layers": {
4+
"go-admin2-HND-staging": {
5+
"source": "mapbox://tileset-source/go-ifrc/go-admin2-HND-src-staging",
6+
"minzoom": 10,
7+
"maxzoom": 14
8+
}
9+
}
10+
}
11+

mapbox/admin2/HND.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": 1,
3+
"layers": {
4+
"go-admin2-HND": {
5+
"source": "mapbox://tileset-source/go-ifrc/go-admin2-HND-src",
6+
"minzoom": 10,
7+
"maxzoom": 14
8+
}
9+
}
10+
}
11+

mapbox/admin2/HTI-staging.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": 1,
3+
"layers": {
4+
"go-admin2-HTI-staging": {
5+
"source": "mapbox://tileset-source/go-ifrc/go-admin2-HTI-src-staging",
6+
"minzoom": 10,
7+
"maxzoom": 14
8+
}
9+
}
10+
}
11+

mapbox/admin2/HTI.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": 1,
3+
"layers": {
4+
"go-admin2-HTI": {
5+
"source": "mapbox://tileset-source/go-ifrc/go-admin2-HTI-src",
6+
"minzoom": 10,
7+
"maxzoom": 14
8+
}
9+
}
10+
}
11+

mapbox/admin2/SLV-staging.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": 1,
3+
"layers": {
4+
"go-admin2-SLV-staging": {
5+
"source": "mapbox://tileset-source/go-ifrc/go-admin2-SLV-src-staging",
6+
"minzoom": 10,
7+
"maxzoom": 14
8+
}
9+
}
10+
}
11+

mapbox/admin2/SLV.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": 1,
3+
"layers": {
4+
"go-admin2-SLV": {
5+
"source": "mapbox://tileset-source/go-ifrc/go-admin2-SLV-src",
6+
"minzoom": 10,
7+
"maxzoom": 14
8+
}
9+
}
10+
}
11+

0 commit comments

Comments
 (0)