Update ChristchurchZone model name to ChristchurchRegion
This commit is contained in:
parent
3f251e4c68
commit
36746729ec
5 changed files with 12 additions and 12 deletions
|
@ -4,7 +4,7 @@ from django.contrib.gis.utils import LayerMapping
|
|||
from pathlib import Path
|
||||
|
||||
import right_tree.api.data
|
||||
from right_tree.api.models import SoilLayer, EcologicalDistrictLayer, ChristchurchZone
|
||||
from right_tree.api.models import SoilLayer, EcologicalDistrictLayer, ChristchurchRegion
|
||||
|
||||
# Auto-generated `LayerMapping` dictionary for SoilLayers model
|
||||
soillayer_mapping = {
|
||||
|
@ -25,8 +25,8 @@ ecologicaldistrictlayer_mapping = {
|
|||
'geom': 'POLYGON',
|
||||
}
|
||||
|
||||
# Auto-generated `LayerMapping` dictionary for ChristchurchZone model
|
||||
christchurchzone_mapping = {
|
||||
# Auto-generated `LayerMapping` dictionary for ChristchurchRegion model
|
||||
christchurchregion_mapping = {
|
||||
'objectid': 'OBJECTID',
|
||||
'name': 'NAME',
|
||||
'geom': 'MULTIPOLYGON',
|
||||
|
@ -35,7 +35,7 @@ christchurchzone_mapping = {
|
|||
# Shapefiles
|
||||
soillayer_shp = Path(right_tree.api.data.__file__).resolve().parent / 'resources' / 'fundamental_soil_layers' / 'fundamental-soil-layers-new-zealand-soil-classification.shp'
|
||||
ecologicaldistrictlayer_shp = Path(right_tree.api.data.__file__).resolve().parent / 'resources' / 'ecological_districts' / 'DOC_EcologicalDistricts_2021_08_02.shp'
|
||||
christchurchzone_shp = Path(right_tree.api.data.__file__).resolve().parent / 'resources' / 'chch_zone' / 'Greater_Christchurch_Area.shp'
|
||||
christchurchregion_shp = Path(right_tree.api.data.__file__).resolve().parent / 'resources' / 'chch_zone' / 'Greater_Christchurch_Area.shp'
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = 'Ingests the shapefile data for ecological regions and soil layers.'
|
||||
|
@ -52,6 +52,6 @@ class Command(BaseCommand):
|
|||
self.stdout.write(self.style.SUCCESS('Ecological district layers loaded succesfully.'))
|
||||
|
||||
self.stdout.write('Loading christchurch zone layer...')
|
||||
christchurchzonelayer_lm = LayerMapping(ChristchurchZone, christchurchzone_shp, christchurchzone_mapping, transform=False)
|
||||
christchurchzonelayer_lm.save(strict=True)
|
||||
christchurchregionlayer_lm = LayerMapping(ChristchurchRegion, christchurchregion_shp, christchurchregion_mapping, transform=False)
|
||||
christchurchregionlayer_lm.save(strict=True)
|
||||
self.stdout.write(self.style.SUCCESS(' Christchurch zone layer loaded succesfully.'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue