diff --git a/hub/management/commands/import_areas.py b/hub/management/commands/import_areas.py index f8b668577..66fe63e28 100644 --- a/hub/management/commands/import_areas.py +++ b/hub/management/commands/import_areas.py @@ -41,9 +41,13 @@ def add_arguments(self, parser): ) def handle(self, quiet: bool = False, *args, **options): + quiet = True mapit_client = mapit.MapIt() for b_type in self.boundary_types: areas = mapit_client.areas_of_type(b_type["mapit_type"]) + print( + f"fetched mapit areas with type {b_type['mapit_type']}, our type {b_type['code']}" + ) area_type, created = AreaType.objects.get_or_create( code=b_type["code"], area_type=b_type["area_type"], @@ -56,6 +60,7 @@ def handle(self, quiet: bool = False, *args, **options): if not quiet: print(f"Importing {b_type['name']} Areas") for area in tqdm(areas, disable=quiet): + print(f"looking at {area['name']}, mapit type {area['type']}") try: geom = mapit_client.area_geometry(area["id"]) geom = { @@ -72,6 +77,9 @@ def handle(self, quiet: bool = False, *args, **options): print(f"could not find mapit area for {area['name']}") geom = None + print( + f"creating area for {area['name']} with GSS {area['codes']['gss']}, mapit_id {area['id']}" + ) a, created = Area.objects.update_or_create( name=area["name"], area_type=area_type, @@ -83,3 +91,6 @@ def handle(self, quiet: bool = False, *args, **options): a.geometry = geom a.save() + print("--") + + print("\n\033[31m######################\033[0m\n")