Skip to content

Commit

Permalink
fix: remove remaining references to deprecated hochmontan zones
Browse files Browse the repository at this point in the history
  • Loading branch information
friedjoff committed Apr 9, 2020
1 parent b114ac8 commit 35b472e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 51 deletions.
46 changes: 8 additions & 38 deletions lib/data/locations.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,12 @@
{
"1": {
"20": 1,
"40": 7,
"50": 9,
"60": 11,
"81": 14,
"82": 14,
"83": 14,
"90": 22,
"100": 26
},
"3": { "81": 18, "82": 18, "83": 18, "90": 22, "100": 27 },
"4": { "20": 3, "81": 20, "82": 20, "83": 20, "90": 23, "100": 24 },
"M": { "20": 1, "40": 7, "50": 9, "60": 11, "81": 14, "82": 14, "83": 14 },
"J": { "20": 1, "40": 7, "50": 9, "60": 11, "81": 14, "82": 14, "83": 14 },
"2a": {
"20": 2,
"40": 8,
"50": 10,
"60": 12,
"81": 17,
"82": 17,
"83": 17,
"90": 22,
"100": 27
},
"5a": {
"10": 5,
"20": 4,
"30": 4,
"70": 13,
"81": 21,
"82": 21,
"83": 21,
"90": 25,
"100": 25
},
"1": { "20": 1, "40": 7, "50": 9, "60": 11, "80": 14, "90": 22, "100": 26 },
"3": { "80": 18, "90": 22, "100": 27 },
"4": { "20": 3, "80": 20, "90": 23, "100": 24 },
"M": { "20": 1, "40": 7, "50": 9, "60": 11, "80": 14 },
"J": { "20": 1, "40": 7, "50": 9, "60": 11, "80": 14 },
"2a": { "20": 2, "40": 8, "50": 10, "60": 12, "80": 17, "90": 22, "100": 27 },
"5a": { "10": 5, "20": 4, "30": 4, "70": 13, "80": 21, "90": 25, "100": 25 },
"5b": { "10": 5, "20": 4, "30": 4, "70": 13, "90": 25, "100": 25 },
"2b": { "20": 2, "81": 17, "82": 17, "83": 17, "90": 22, "100": 27 },
"2b": { "20": 2, "80": 17, "90": 22, "100": 27 },
"Me": { "10": 6, "30": 6 }
}
9 changes: 2 additions & 7 deletions lib/data/nais/ecogram.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,12 @@ const aggregateEcograms = () => {
const ecogram = JSON.parse(rawdata);

const { forestEcoregions, altitudinalZones } = ecogram.properties || {};
// TODO: remove the following variable once branch "hochmontan" is merged!
const filteredAltitudinalZones = altitudinalZones.includes('80')
? [...altitudinalZones.filter((z) => z !== '80'), '81', '82', '83']
: altitudinalZones;

validate('forestEcoregion', forestEcoregions);
validate('altitudinalZone', filteredAltitudinalZones);
validate('altitudinalZone', altitudinalZones);

forestEcoregions.forEach((region) => {
locations[region] = locations[region] || {};
filteredAltitudinalZones.forEach((zone) => {
altitudinalZones.forEach((zone) => {
locations[region][zone] = id;
});
});
Expand Down
10 changes: 4 additions & 6 deletions lib/data/sql/V3__create_types.sql
Original file line number Diff line number Diff line change
Expand Up @@ -577,10 +577,9 @@ SELECT sisf_nr::int AS code,
FROM nat_arten_mstr
WHERE art_erk_zeik = '1'
AND art_hs_collin = '1'
UNION -- TODO: switch to 80 once hochmontan branch has been merged!

UNION
SELECT sisf_nr::int AS code,
'81' AS altitudinal_zone_code
'80' AS altitudinal_zone_code
FROM nat_arten_mstr
WHERE art_erk_zeik = '1'
AND art_hs_hochmont = '1'
Expand Down Expand Up @@ -851,10 +850,9 @@ FROM
(SELECT unnest(enum_range(null::treetype)) AS treetype) foo
JOIN nat_arten_mstr nais ON nais.sisf_nr = foo.treetype::text
WHERE art_hs_collin = '1'
UNION -- TODO: switch to 80 once hochmontan branch has been merged!

UNION
SELECT foo.treetype AS treetype_code,
'81' AS altitudinal_zone_code
'80' AS altitudinal_zone_code
FROM
(SELECT unnest(enum_range(null::treetype)) AS treetype) foo
JOIN nat_arten_mstr nais ON nais.sisf_nr = foo.treetype::text
Expand Down

0 comments on commit 35b472e

Please sign in to comment.