From c2328646f51433ee51d803223d3ca824b4e9993e Mon Sep 17 00:00:00 2001 From: Dana Lambert Date: Thu, 2 Dec 2021 14:23:37 +1300 Subject: [PATCH] Update zone ingestion and fixtures --- .../api/data/fixtures/006_zones.json | 284 +++++++++++++++++- .../fixtures/008_sample_zone_segments.json | 52 ---- .../api/management/commands/loadsitedata.py | 10 +- 3 files changed, 286 insertions(+), 60 deletions(-) delete mode 100644 backend/right_tree/api/data/fixtures/008_sample_zone_segments.json diff --git a/backend/right_tree/api/data/fixtures/006_zones.json b/backend/right_tree/api/data/fixtures/006_zones.json index eeca0ad..5726a5a 100644 --- a/backend/right_tree/api/data/fixtures/006_zones.json +++ b/backend/right_tree/api/data/fixtures/006_zones.json @@ -6,7 +6,9 @@ "name": "PERMANENT RIVER/STREAM", "variant": "Fresh Plain", "refined_variant": null, + "habitat": 2, "redirect_habitat": null, + "related_svg_segment": "CS", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -18,7 +20,9 @@ "name": "VINEYARD", "variant": "Ground Cover", "refined_variant": null, + "habitat": 10, "redirect_habitat": null, + "related_svg_segment": "CD", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -28,9 +32,11 @@ "pk": 3, "fields": { "name": "BUSH PROFILE POSITION", - "variant": "Epiphytes", + "variant": "Epiphytes & Mistletoe", "refined_variant": "+ on logs", + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "EK", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -42,7 +48,9 @@ "name": "Streams/Rivers", "variant": "see RIPARIAN/WETLANDS/PONDS", "refined_variant": null, + "habitat": 10, "redirect_habitat": null, + "related_svg_segment": "BV", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -54,7 +62,9 @@ "name": "ROOF GARDEN", "variant": "Any herb or shrub from region", "refined_variant": null, + "habitat": 3, "redirect_habitat": null, + "related_svg_segment": "AS", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -66,7 +76,9 @@ "name": "EPHEMERAL", "variant": "Upper Bank", "refined_variant": null, + "habitat": 2, "redirect_habitat": null, + "related_svg_segment": "CF", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -78,7 +90,9 @@ "name": "SHELTERBELT", "variant": "1-2 Row", "refined_variant": null, + "habitat": 10, "redirect_habitat": null, + "related_svg_segment": "CA", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -90,7 +104,9 @@ "name": "PERMANENT RIVER/STREAM", "variant": "Upper Scarp", "refined_variant": "Sunny", + "habitat": 2, "redirect_habitat": null, + "related_svg_segment": "CJ", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -102,7 +118,9 @@ "name": "Open Wetland/Lake", "variant": "Swamp", "refined_variant": "Aquatic submerged", + "habitat": 4, "redirect_habitat": null, + "related_svg_segment": "DU", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -114,7 +132,9 @@ "name": "SAND", "variant": "2ND BACK DUNE STABLE", "refined_variant": "Back", + "habitat": 6, "redirect_habitat": null, + "related_svg_segment": "DI", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -126,7 +146,9 @@ "name": "SAND", "variant": "FOREDUNE", "refined_variant": "Back", + "habitat": 6, "redirect_habitat": null, + "related_svg_segment": "DA", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -138,7 +160,9 @@ "name": "PERMANENT RIVER/STREAM", "variant": "Upper Scarp", "refined_variant": "Shady", + "habitat": 2, "redirect_habitat": null, + "related_svg_segment": "CK", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -150,7 +174,9 @@ "name": "LIVING WALL", "variant": "Sunny", "refined_variant": null, + "habitat": 1, "redirect_habitat": null, + "related_svg_segment": "Y", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -162,7 +188,9 @@ "name": "Country/Valley", "variant": "Slip", "refined_variant": "Centre/Wet", + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "EW", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -174,7 +202,9 @@ "name": "STREET/SPECIMEN", "variant": "Trees", "refined_variant": null, + "habitat": 1, "redirect_habitat": null, + "related_svg_segment": "AK", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -186,7 +216,9 @@ "name": "LAWN", "variant": "Moist", "refined_variant": null, + "habitat": 1, "redirect_habitat": null, + "related_svg_segment": "AI", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -198,7 +230,9 @@ "name": "PERMANENT RIVER/STREAM", "variant": "Lower Scarp", "refined_variant": "Sunny", + "habitat": 2, "redirect_habitat": null, + "related_svg_segment": "CL", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -209,8 +243,10 @@ "fields": { "name": "RAIL", "variant": "Inner Rail", - "refined_variant": "High Mow", + "refined_variant": "High Mow turf", + "habitat": 9, "redirect_habitat": null, + "related_svg_segment": "BI", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -222,7 +258,9 @@ "name": "PERMANENT RIVER/STREAM", "variant": "Lower Scarp", "refined_variant": "Shady", + "habitat": 2, "redirect_habitat": null, + "related_svg_segment": "CM", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -234,7 +272,9 @@ "name": "SWALE", "variant": "Veg Edge", "refined_variant": null, + "habitat": 3, "redirect_habitat": null, + "related_svg_segment": "AW", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -246,7 +286,9 @@ "name": "SAND", "variant": "2ND BACK DUNE STABLE", "refined_variant": "Front & Crest", + "habitat": 6, "redirect_habitat": null, + "related_svg_segment": "DH", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -258,7 +300,9 @@ "name": "ROAD VERGE/TRAFFIC ISLAND", "variant": "Frangible Edge", "refined_variant": null, + "habitat": 9, "redirect_habitat": null, + "related_svg_segment": "BO", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -270,7 +314,9 @@ "name": "RAIN GARDEN", "variant": "Road Edge", "refined_variant": null, + "habitat": 3, "redirect_habitat": null, + "related_svg_segment": "BA", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -282,7 +328,9 @@ "name": "HILL ELEMENTS", "variant": "Toeslope", "refined_variant": "Shady", + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "ET", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -294,7 +342,9 @@ "name": "VINEYARD", "variant": "Vines", "refined_variant": null, + "habitat": 10, "redirect_habitat": null, + "related_svg_segment": "CE", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -306,7 +356,9 @@ "name": "HILL ELEMENTS", "variant": "Upper Slope", "refined_variant": "Sunny", + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "EM", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -318,7 +370,9 @@ "name": "PERMANENT RIVER/STREAM", "variant": "Upper Bank", "refined_variant": null, + "habitat": 2, "redirect_habitat": null, + "related_svg_segment": "CQ", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -330,7 +384,9 @@ "name": "SAND", "variant": "FOREDUNE", "refined_variant": "Slack", + "habitat": 6, "redirect_habitat": null, + "related_svg_segment": "DB", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -342,7 +398,9 @@ "name": "HILL ELEMENTS", "variant": "Upper Slope", "refined_variant": "Shady", + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "EN", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -354,7 +412,9 @@ "name": "Streams/Ponds", "variant": "See Riparian/Wetlands/Lakes", "refined_variant": null, + "habitat": 1, "redirect_habitat": null, + "related_svg_segment": "AP", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -366,7 +426,9 @@ "name": "Open Wetland/Lake", "variant": "Swamp", "refined_variant": "Aquatic emergent", + "habitat": 4, "redirect_habitat": null, + "related_svg_segment": "DW", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -378,7 +440,9 @@ "name": "WALL CREVICES", "variant": "Shady", "refined_variant": null, + "habitat": 1, "redirect_habitat": null, + "related_svg_segment": "AD", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -390,7 +454,9 @@ "name": "Matauranga Maori", "variant": "Fibre/Wood", "refined_variant": "Domestic", + "habitat": 8, "redirect_habitat": null, + "related_svg_segment": "EC", "ignore_soil_order_filter": false, "ignore_location_filter": true } @@ -402,7 +468,9 @@ "name": "Matauranga Maori", "variant": "Rongoa/Med", "refined_variant": null, + "habitat": 8, "redirect_habitat": null, + "related_svg_segment": "EE", "ignore_soil_order_filter": false, "ignore_location_filter": true } @@ -414,7 +482,9 @@ "name": "WALL CREVICES", "variant": "Sunny", "refined_variant": null, + "habitat": 1, "redirect_habitat": null, + "related_svg_segment": "AC", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -426,7 +496,9 @@ "name": "SWALE", "variant": "Wet Bed", "refined_variant": null, + "habitat": 3, "redirect_habitat": null, + "related_svg_segment": "AU", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -438,7 +510,9 @@ "name": "PERMANENT RIVER/STREAM", "variant": "Terrace Top", "refined_variant": "See Standard Restoration for Locality", + "habitat": 2, "redirect_habitat": null, + "related_svg_segment": "CI", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -450,7 +524,9 @@ "name": "ROAD VERGE/TRAFFIC ISLAND", "variant": "Cut/Fill", "refined_variant": "mid slope", + "habitat": 9, "redirect_habitat": null, + "related_svg_segment": "BS", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -462,7 +538,9 @@ "name": "Open Wetland/Lake", "variant": "Grazing Marsh", "refined_variant": null, + "habitat": 4, "redirect_habitat": null, + "related_svg_segment": "EA", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -474,7 +552,9 @@ "name": "EPHEMERAL", "variant": "Lower Bank", "refined_variant": null, + "habitat": 2, "redirect_habitat": null, + "related_svg_segment": "CG", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -486,7 +566,9 @@ "name": "LANDFILL", "variant": "compacted", "refined_variant": null, + "habitat": 1, "redirect_habitat": null, + "related_svg_segment": "AM", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -498,7 +580,9 @@ "name": "HEDGE", "variant": null, "refined_variant": null, + "habitat": 1, "redirect_habitat": null, + "related_svg_segment": "AJ", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -510,7 +594,9 @@ "name": "Open Wetland/Lake", "variant": "Bog", "refined_variant": null, + "habitat": 4, "redirect_habitat": null, + "related_svg_segment": "EB", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -522,7 +608,9 @@ "name": "Matauranga Maori", "variant": "Taonga/Taoka", "refined_variant": null, + "habitat": 8, "redirect_habitat": null, + "related_svg_segment": "EF", "ignore_soil_order_filter": false, "ignore_location_filter": true } @@ -534,7 +622,9 @@ "name": "ROAD VERGE/TRAFFIC ISLAND", "variant": "Cut/Fill", "refined_variant": "crest", + "habitat": 9, "redirect_habitat": null, + "related_svg_segment": "BR", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -546,7 +636,9 @@ "name": "BUSH PROFILE POSITION", "variant": "Skin", "refined_variant": "outer 1-2 rows", + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "EH", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -558,7 +650,9 @@ "name": "Country/Valley", "variant": "Moraine", "refined_variant": null, + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "EY", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -570,7 +664,9 @@ "name": "LIVING SCREEN", "variant": "Pergola", "refined_variant": null, + "habitat": 1, "redirect_habitat": null, + "related_svg_segment": "AA", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -582,7 +678,9 @@ "name": "SHRUBBERY", "variant": "Shrubs", "refined_variant": "Shrubbery", + "habitat": 1, "redirect_habitat": null, + "related_svg_segment": "AL", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -594,7 +692,9 @@ "name": "RAIL", "variant": "Outer Rail", "refined_variant": "Back Bush", + "habitat": 9, "redirect_habitat": null, + "related_svg_segment": "BK", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -606,7 +706,9 @@ "name": "ROAD VERGE/TRAFFIC ISLAND", "variant": "Mown Edge", "refined_variant": "High Mow", + "habitat": 9, "redirect_habitat": null, + "related_svg_segment": "BL", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -618,7 +720,9 @@ "name": "LOW TIDE", "variant": "Mud Flats", "refined_variant": "Eel Grass", + "habitat": 7, "redirect_habitat": null, + "related_svg_segment": "DJ", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -630,7 +734,9 @@ "name": "ROAD VERGE/TRAFFIC ISLAND", "variant": "Water Table", "refined_variant": null, + "habitat": 9, "redirect_habitat": null, + "related_svg_segment": "BM", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -642,7 +748,9 @@ "name": "RETENTION POND", "variant": "Wet Floodplain", "refined_variant": null, + "habitat": 3, "redirect_habitat": null, + "related_svg_segment": "BD", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -654,7 +762,9 @@ "name": "ROAD VERGE/TRAFFIC ISLAND", "variant": "Cut/Fill", "refined_variant": "foot/toe", + "habitat": 9, "redirect_habitat": null, + "related_svg_segment": "BT", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -666,7 +776,9 @@ "name": "SPRAY ZONE", "variant": "Coastal", "refined_variant": "Bush Centre", + "habitat": 7, "redirect_habitat": null, + "related_svg_segment": "DT", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -678,7 +790,9 @@ "name": "RETENTION POND", "variant": "Wet Margin", "refined_variant": null, + "habitat": 3, "redirect_habitat": null, + "related_svg_segment": "BE", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -690,7 +804,9 @@ "name": "SPRAY ZONE", "variant": "Coastal", "refined_variant": "Bush Edge", + "habitat": 7, "redirect_habitat": 2, + "related_svg_segment": "DS", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -702,7 +818,9 @@ "name": "PERMANENT RIVER/STREAM", "variant": "Lower Bank", "refined_variant": null, + "habitat": 2, "redirect_habitat": null, + "related_svg_segment": "CR", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -714,7 +832,9 @@ "name": "Open Wetland/Lake", "variant": "Swamp", "refined_variant": "Fluctuating turf", + "habitat": 4, "redirect_habitat": null, + "related_svg_segment": "DY", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -726,7 +846,9 @@ "name": "DETENTION BASIN", "variant": "Dry Edge", "refined_variant": null, + "habitat": 3, "redirect_habitat": null, + "related_svg_segment": "BB", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -738,7 +860,9 @@ "name": "Homestead", "variant": "see URBAN", "refined_variant": null, + "habitat": 10, "redirect_habitat": null, + "related_svg_segment": "BU", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -750,7 +874,9 @@ "name": "HERBACEOUS ", "variant": "Border", "refined_variant": null, + "habitat": 1, "redirect_habitat": null, + "related_svg_segment": "AG", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -762,7 +888,9 @@ "name": "RAIN GARDEN", "variant": "Veg Edge", "refined_variant": null, + "habitat": 3, "redirect_habitat": null, + "related_svg_segment": "AX", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -774,7 +902,9 @@ "name": "SPRAY ZONE", "variant": "Exposed/Splash Zone", "refined_variant": "Banks/Rocks", + "habitat": 7, "redirect_habitat": null, + "related_svg_segment": "DQ", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -786,7 +916,9 @@ "name": "LOW TIDE", "variant": "Lower Marsh", "refined_variant": "Mangrove", + "habitat": 7, "redirect_habitat": null, + "related_svg_segment": "DL", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -798,7 +930,9 @@ "name": "Bush Garden", "variant": "See Standard Restoration for Locality", "refined_variant": null, + "habitat": 1, "redirect_habitat": null, + "related_svg_segment": "AO", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -810,7 +944,9 @@ "name": "PERMANENT RIVER/STREAM", "variant": "Backswamp", "refined_variant": "Floodplain", + "habitat": 2, "redirect_habitat": null, + "related_svg_segment": "CO", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -822,7 +958,9 @@ "name": "HILL ELEMENTS", "variant": "Midslope", "refined_variant": "Sunny", + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "EO", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -834,7 +972,9 @@ "name": "Matauranga Maori", "variant": "Kai/Food", "refined_variant": null, + "habitat": 8, "redirect_habitat": null, + "related_svg_segment": "ED", "ignore_soil_order_filter": false, "ignore_location_filter": true } @@ -846,7 +986,9 @@ "name": "RAIL", "variant": "Trackside", "refined_variant": "High Mow", + "habitat": 9, "redirect_habitat": null, + "related_svg_segment": "BH", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -858,7 +1000,9 @@ "name": "Bush", "variant": "see BUSH", "refined_variant": null, + "habitat": 10, "redirect_habitat": 1, + "related_svg_segment": "BW", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -870,7 +1014,9 @@ "name": "SAND", "variant": "1ST BACK DUNE STABLE", "refined_variant": "Back", + "habitat": 6, "redirect_habitat": null, + "related_svg_segment": "DE", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -882,7 +1028,9 @@ "name": "HILL ELEMENTS", "variant": "Footslope", "refined_variant": "Sunny", + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "EQ", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -894,7 +1042,9 @@ "name": "PERMANENT RIVER/STREAM", "variant": "Scarp Footslope", "refined_variant": "toe", + "habitat": 2, "redirect_habitat": null, + "related_svg_segment": "CN", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -906,7 +1056,9 @@ "name": "ROCK GARDEN", "variant": "Shady", "refined_variant": null, + "habitat": 1, "redirect_habitat": null, + "related_svg_segment": "AF", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -918,7 +1070,9 @@ "name": "HIGH TIDE", "variant": "Upper Marsh", "refined_variant": "Mangrove", + "habitat": 7, "redirect_habitat": null, + "related_svg_segment": "DO", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -930,7 +1084,9 @@ "name": "Open Wetland/Lake", "variant": "Swamp", "refined_variant": "Aquatic floating", + "habitat": 4, "redirect_habitat": null, + "related_svg_segment": "DV", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -942,7 +1098,9 @@ "name": "ROAD VERGE/TRAFFIC ISLAND", "variant": "Sight line", "refined_variant": "High Mow", + "habitat": 9, "redirect_habitat": null, + "related_svg_segment": "BN", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -954,7 +1112,9 @@ "name": "GRAVEL/CRACKS", "variant": "Permeable Paving", "refined_variant": null, + "habitat": 1, "redirect_habitat": null, + "related_svg_segment": "AB", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -966,7 +1126,9 @@ "name": "PERMANENT RIVER/STREAM", "variant": "Emergent", "refined_variant": null, + "habitat": 2, "redirect_habitat": null, + "related_svg_segment": "CT", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -978,7 +1140,9 @@ "name": "EPHEMERAL", "variant": "Bed", "refined_variant": null, + "habitat": 2, "redirect_habitat": null, + "related_svg_segment": "CH", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -990,7 +1154,9 @@ "name": "PIVOT IRRIGATOR", "variant": "Under Pivot Arm", "refined_variant": null, + "habitat": 10, "redirect_habitat": null, + "related_svg_segment": "BY", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1002,7 +1168,9 @@ "name": "SWALE", "variant": "Road Edge", "refined_variant": null, + "habitat": 3, "redirect_habitat": null, + "related_svg_segment": "AT", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1014,7 +1182,9 @@ "name": "PERMANENT RIVER/STREAM", "variant": "Levee", "refined_variant": null, + "habitat": 2, "redirect_habitat": null, + "related_svg_segment": "CP", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -1026,7 +1196,9 @@ "name": "SAND", "variant": "FOREDUNE", "refined_variant": "Sand Plain", + "habitat": 6, "redirect_habitat": null, + "related_svg_segment": "DC", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1038,7 +1210,9 @@ "name": "ROAD VERGE/TRAFFIC ISLAND", "variant": "Mid", "refined_variant": null, + "habitat": 9, "redirect_habitat": null, + "related_svg_segment": "BP", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1050,7 +1224,9 @@ "name": "Country/Valley", "variant": "Outcrop", "refined_variant": null, + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "EX", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1062,7 +1238,9 @@ "name": "HILL ELEMENTS", "variant": "Crest", "refined_variant": null, + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "EL", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1074,7 +1252,9 @@ "name": "SAND", "variant": "FOREDUNE", "refined_variant": "Crest", + "habitat": 6, "redirect_habitat": null, + "related_svg_segment": "CZ", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1086,7 +1266,9 @@ "name": "RAIN GARDEN", "variant": "Bed", "refined_variant": null, + "habitat": 3, "redirect_habitat": null, + "related_svg_segment": "AY", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -1098,7 +1280,9 @@ "name": "ROAD VERGE/TRAFFIC ISLAND", "variant": "Back/Fence", "refined_variant": "bush", + "habitat": 9, "redirect_habitat": null, + "related_svg_segment": "BQ", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1110,7 +1294,9 @@ "name": "PERMANENT RIVER/STREAM", "variant": "Aquatic Bed", "refined_variant": null, + "habitat": 2, "redirect_habitat": null, + "related_svg_segment": "CU", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -1122,7 +1308,9 @@ "name": "Country/Valley", "variant": "Seepage", "refined_variant": null, + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "EZ", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1134,7 +1322,9 @@ "name": "LAWN", "variant": "Dry", "refined_variant": null, + "habitat": 1, "redirect_habitat": null, + "related_svg_segment": "AH", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -1146,7 +1336,9 @@ "name": "LIVING WALL", "variant": "Shady/Indoors", "refined_variant": null, + "habitat": 1, "redirect_habitat": null, + "related_svg_segment": "Z", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -1158,7 +1350,9 @@ "name": "GRAVEL/BOULDER BEACH", "variant": "Crest & Back", "refined_variant": "Ridge", + "habitat": 6, "redirect_habitat": null, + "related_svg_segment": "CW", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1170,7 +1364,9 @@ "name": "LOW TIDE", "variant": "Lower Marsh", "refined_variant": "Reeds", + "habitat": 7, "redirect_habitat": null, + "related_svg_segment": "DK", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -1181,8 +1377,10 @@ "fields": { "name": "Open Wetland/Lake", "variant": "Swamp", - "refined_variant": "Fluctuating Tussock", + "refined_variant": "Fluctuating Tussock scrub", + "habitat": 4, "redirect_habitat": null, + "related_svg_segment": "DX", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -1194,7 +1392,9 @@ "name": "DETENTION BASIN", "variant": "Dry Bed", "refined_variant": null, + "habitat": 3, "redirect_habitat": null, + "related_svg_segment": "BC", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -1206,7 +1406,9 @@ "name": "Country/Valley", "variant": "Montane", "refined_variant": null, + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "FA", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1218,7 +1420,9 @@ "name": "HILL ELEMENTS", "variant": "Midslope", "refined_variant": "Shady", + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "EP", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1230,7 +1434,9 @@ "name": "SWALE", "variant": "Dry Bed", "refined_variant": null, + "habitat": 3, "redirect_habitat": null, + "related_svg_segment": "AV", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1242,7 +1448,9 @@ "name": "SAND", "variant": "FOREDUNE", "refined_variant": "Toe", + "habitat": 6, "redirect_habitat": null, + "related_svg_segment": "CX", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1254,7 +1462,9 @@ "name": "RETENTION POND", "variant": "Aquatic", "refined_variant": null, + "habitat": 3, "redirect_habitat": null, + "related_svg_segment": "BG", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -1266,7 +1476,9 @@ "name": "SAND", "variant": "1ST BACK DUNE STABLE", "refined_variant": "Salt turf", + "habitat": 6, "redirect_habitat": null, + "related_svg_segment": "DG", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1278,7 +1490,9 @@ "name": "HIGH TIDE", "variant": "Upper Marsh", "refined_variant": "Reeds", + "habitat": 7, "redirect_habitat": null, + "related_svg_segment": "DN", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -1290,7 +1504,9 @@ "name": "SAND", "variant": "FOREDUNE", "refined_variant": "Front Slope", + "habitat": 6, "redirect_habitat": null, + "related_svg_segment": "CY", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1302,7 +1518,9 @@ "name": "BUSH PROFILE POSITION", "variant": "Core", "refined_variant": "inner", + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "EJ", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1314,7 +1532,9 @@ "name": "LOW TIDE", "variant": "Lagoon", "refined_variant": "Reeds", + "habitat": 7, "redirect_habitat": null, + "related_svg_segment": "DM", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -1326,7 +1546,9 @@ "name": "ROCK GARDEN", "variant": "Sunny", "refined_variant": null, + "habitat": 1, "redirect_habitat": null, + "related_svg_segment": "AE", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -1338,7 +1560,9 @@ "name": "SAND", "variant": "1ST BACK DUNE STABLE", "refined_variant": "Interdune Ephemeral Wetland", + "habitat": 6, "redirect_habitat": null, + "related_svg_segment": "DF", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1350,7 +1574,9 @@ "name": "PIVOT IRRIGATOR", "variant": "Corner & Other Bush", "refined_variant": "See Standard Bush Restoration for Locality with emphasis on skin and border", + "habitat": 10, "redirect_habitat": null, + "related_svg_segment": "BZ", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1362,7 +1588,9 @@ "name": "Country/Valley", "variant": "Slip", "refined_variant": "Edge", + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "EV", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1374,7 +1602,9 @@ "name": "SAND", "variant": "1ST BACK DUNE STABLE", "refined_variant": "Front & Crest", + "habitat": 6, "redirect_habitat": null, + "related_svg_segment": "DD", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1386,7 +1616,9 @@ "name": "RETENTION POND", "variant": "Emergent", "refined_variant": null, + "habitat": 3, "redirect_habitat": null, + "related_svg_segment": "BF", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -1398,7 +1630,9 @@ "name": "Hedgerow", "variant": "< 2m", "refined_variant": null, + "habitat": 10, "redirect_habitat": null, + "related_svg_segment": "BX", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1410,7 +1644,9 @@ "name": "GRAVEL/BOULDER BEACH", "variant": "Beach Front", "refined_variant": null, + "habitat": 6, "redirect_habitat": null, + "related_svg_segment": "CV", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1422,7 +1658,9 @@ "name": "RAIL", "variant": "Inner Rail", "refined_variant": "LF Shrubbery", + "habitat": 9, "redirect_habitat": null, + "related_svg_segment": "BJ", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1434,7 +1672,9 @@ "name": "SPRAY ZONE", "variant": "Exposed", "refined_variant": "Cliffs", + "habitat": 7, "redirect_habitat": null, + "related_svg_segment": "DR", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1446,7 +1686,9 @@ "name": "GREEN ROOF", "variant": "Shady", "refined_variant": null, + "habitat": 3, "redirect_habitat": null, + "related_svg_segment": "AR", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -1458,7 +1700,9 @@ "name": "GREEN ROOF", "variant": "Sunny", "refined_variant": null, + "habitat": 3, "redirect_habitat": null, + "related_svg_segment": "AQ", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -1470,7 +1714,9 @@ "name": "HILL ELEMENTS", "variant": "Toeslope", "refined_variant": "Sunny", + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "ES", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1482,7 +1728,9 @@ "name": "Country/Valley", "variant": "Plains/", "refined_variant": "Rolling", + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "EU", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1494,7 +1742,9 @@ "name": "SHELTERBELT", "variant": "3-5 Row", "refined_variant": "Edge", + "habitat": 10, "redirect_habitat": null, + "related_svg_segment": "CB", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1506,7 +1756,9 @@ "name": "HIGH TIDE", "variant": "Highest Marsh", "refined_variant": "Scrub", + "habitat": 7, "redirect_habitat": null, + "related_svg_segment": "DP", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -1518,7 +1770,9 @@ "name": "Open Wetland/Lake", "variant": "Fen", "refined_variant": "reeds/shrubs", + "habitat": 4, "redirect_habitat": null, + "related_svg_segment": "DZ", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -1530,7 +1784,9 @@ "name": "RAIN GARDEN", "variant": "CIPTED Bed", "refined_variant": null, + "habitat": 3, "redirect_habitat": null, + "related_svg_segment": "AZ", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -1542,7 +1798,9 @@ "name": "COURTYARD", "variant": "Protected", "refined_variant": "sheltered", + "habitat": 1, "redirect_habitat": null, + "related_svg_segment": "AN", "ignore_soil_order_filter": true, "ignore_location_filter": false } @@ -1554,7 +1812,9 @@ "name": "BUSH PROFILE POSITION", "variant": "Border", "refined_variant": "next 2-3 rows", + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "EI", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1566,7 +1826,9 @@ "name": "SHELTERBELT", "variant": "3-5 Row", "refined_variant": "Centre", + "habitat": 10, "redirect_habitat": null, + "related_svg_segment": "CC", "ignore_soil_order_filter": false, "ignore_location_filter": false } @@ -1578,7 +1840,23 @@ "name": "HILL ELEMENTS", "variant": "Footslope", "refined_variant": "Shady", + "habitat": 5, "redirect_habitat": null, + "related_svg_segment": "ER", + "ignore_soil_order_filter": false, + "ignore_location_filter": false + } + }, + { + "model": "api.zone", + "pk": 133, + "fields": { + "name": "Matauranga Maori", + "variant": "Fibre/Weaving", + "refined_variant": "Tukutuku/raft", + "habitat": 8, + "redirect_habitat": null, + "related_svg_segment": "EG", "ignore_soil_order_filter": false, "ignore_location_filter": false } diff --git a/backend/right_tree/api/data/fixtures/008_sample_zone_segments.json b/backend/right_tree/api/data/fixtures/008_sample_zone_segments.json deleted file mode 100644 index de71f25..0000000 --- a/backend/right_tree/api/data/fixtures/008_sample_zone_segments.json +++ /dev/null @@ -1,52 +0,0 @@ -[ - { - "model": "api.zoneimagesegment", - "pk": 1, - "fields": { - "zone": 58, - "habitat_image": 1, - "segment_order": 0, - "segment_percentage_width": 7.4 - } - }, - { - "model": "api.zoneimagesegment", - "pk": 2, - "fields": { - "zone": 126, - "habitat_image": 1, - "segment_order": 1, - "segment_percentage_width": 8.7 - } - }, - { - "model": "api.zoneimagesegment", - "pk": 3, - "fields": { - "zone": 98, - "habitat_image": 1, - "segment_order": 2, - "segment_percentage_width": 20.6 - } - }, - { - "model": "api.zoneimagesegment", - "pk": 4, - "fields": { - "zone": 77, - "habitat_image": 1, - "segment_order": 4, - "segment_percentage_width": 33.1 - } - }, - { - "model": "api.zoneimagesegment", - "pk": 5, - "fields": { - "zone": 66, - "habitat_image": 1, - "segment_order": 5, - "segment_percentage_width": 30.2 - } - } -] \ No newline at end of file diff --git a/backend/right_tree/api/management/commands/loadsitedata.py b/backend/right_tree/api/management/commands/loadsitedata.py index f526f11..81c8f68 100644 --- a/backend/right_tree/api/management/commands/loadsitedata.py +++ b/backend/right_tree/api/management/commands/loadsitedata.py @@ -13,8 +13,8 @@ def load_habitat_zone_data(sheet): current_habitat = current_zone = current_variant = current_refined_variant = None - for col in sheet.iter_cols(min_col=SITE_DATA_START_COL, max_col=SITE_DATA_STOP_COL, min_row=HABITAT_ROW, max_row=ZONE_REFINED_VARIANT_ROW, values_only=True): - habitat, zone_name, zone_variant, zone_refined_variant = col + for col in sheet.iter_cols(min_col=SITE_DATA_START_COL, max_col=SITE_DATA_STOP_COL, min_row=HABITAT_ROW, max_row=ZONE_REFINED_VARIANT_ROW): + habitat, zone_name, zone_variant, zone_refined_variant = (cell.value for cell in col) if habitat is not None: current_habitat = habitat @@ -31,15 +31,15 @@ def load_habitat_zone_data(sheet): current_refined_variant = zone_refined_variant if zone_refined_variant is not None else current_refined_variant habitats.add(current_habitat) - zones.add((current_zone, current_variant, current_refined_variant)) + zones.add((current_habitat, current_zone, current_variant, current_refined_variant, col[0].column_letter)) for habitat in habitats: habitat_obj = Habitat(name=habitat) habitat_obj.save() - for zone, variant, refined_variant in zones: + for habitat, zone, variant, refined_variant, col_letter in zones: zone_obj = Zone(name=zone, variant=variant, - refined_variant=refined_variant) + refined_variant=refined_variant, habitat=habitat, related_zone_segment=col_letter) zone_obj.save()