From ff23416efedd1c3609dfd83153a9b92e3d901481 Mon Sep 17 00:00:00 2001 From: hamidhabib-buttons Date: Thu, 6 Feb 2025 12:51:47 -0500 Subject: [PATCH] feat(type): implemented resource type (#319) --- backend/prisma/schema.prisma | 1 + .../dto/recreation-resource.dto.ts | 7 ++ .../recreation-resource.service.spec.ts | 8 ++ .../recreation-resource.service.ts | 2 + frontend/src/components/layout/PageMenu.scss | 6 + .../rec-resource/RecResourcePage.tsx | 5 +- .../models/RecreationResourceDto.ts | 3 + .../utils/mapRecreationFeatureCode.test.ts | 21 ++++ .../src/utils/mapRecreationFeatureCode.ts | 14 +++ .../sql/V1.0.0__recreation_resource.sql | 104 +++++++++--------- migrations/fta/sql/V1.0.2__fta_to_rst.sql | 9 +- migrations/rst/sql/V1.0.0__init.sql | 5 +- 12 files changed, 129 insertions(+), 56 deletions(-) create mode 100644 frontend/src/utils/mapRecreationFeatureCode.test.ts create mode 100644 frontend/src/utils/mapRecreationFeatureCode.ts diff --git a/backend/prisma/schema.prisma b/backend/prisma/schema.prisma index 5a43aa47..0b5cf5da 100644 --- a/backend/prisma/schema.prisma +++ b/backend/prisma/schema.prisma @@ -15,6 +15,7 @@ model recreation_resource { description String? @db.VarChar(5000) site_location String? @db.VarChar(200) display_on_public_site Boolean? @default(false) + rec_resource_type String? @db.VarChar(50) recreation_activity recreation_activity[] recreation_status recreation_status? } diff --git a/backend/src/recreation-resource/dto/recreation-resource.dto.ts b/backend/src/recreation-resource/dto/recreation-resource.dto.ts index d14e07c3..4e5c6612 100644 --- a/backend/src/recreation-resource/dto/recreation-resource.dto.ts +++ b/backend/src/recreation-resource/dto/recreation-resource.dto.ts @@ -74,4 +74,11 @@ export class RecreationResourceDto { type: RecreationStatusDto, }) recreation_status: RecreationStatusDto; + + @ApiProperty({ + description: + "Code representing a specific feature associated with the recreation resource", + example: "IF", + }) + rec_resource_type: string; } diff --git a/backend/src/recreation-resource/recreation-resource.service.spec.ts b/backend/src/recreation-resource/recreation-resource.service.spec.ts index ad48a19d..2d3820d2 100644 --- a/backend/src/recreation-resource/recreation-resource.service.spec.ts +++ b/backend/src/recreation-resource/recreation-resource.service.spec.ts @@ -23,6 +23,7 @@ const recreationResource1 = { comment: "Site is open comment", status_code: "01", }, + rec_resource_type: "SIT", }; const recreationResource1Response = { @@ -38,6 +39,7 @@ const recreationResource1Response = { comment: "Site is open comment", status_code: "01", }, + rec_resource_type: "SIT", }; const recreationResource2 = { @@ -54,6 +56,7 @@ const recreationResource2 = { comment: "Site is closed comment", status_code: "02", }, + rec_resource_type: "RTR", }; const recreationResource2Response = { @@ -64,6 +67,7 @@ const recreationResource2Response = { comment: "Site is closed comment", status_code: "02", }, + rec_resource_type: "RTR", }; const recreationResource3 = { @@ -87,6 +91,7 @@ const recreationResource3 = { comment: "Site is active comment", status_code: "01", }, + rec_resource_type: "RR", }; const recreationResource3Response = { @@ -102,6 +107,7 @@ const recreationResource3Response = { comment: "Site is active comment", status_code: "01", }, + rec_resource_type: "RR", }; const recreationResource4 = { @@ -131,6 +137,7 @@ const recreationResource4 = { }, ], recreation_status: null, + rec_resource_type: "IF", }; const recreationResource4Response = { @@ -154,6 +161,7 @@ const recreationResource4Response = { comment: undefined, status_code: undefined, }, + rec_resource_type: "IF", }; const recresourceArray = [ diff --git a/backend/src/recreation-resource/recreation-resource.service.ts b/backend/src/recreation-resource/recreation-resource.service.ts index dc5ad83c..8c8371b5 100644 --- a/backend/src/recreation-resource/recreation-resource.service.ts +++ b/backend/src/recreation-resource/recreation-resource.service.ts @@ -17,6 +17,7 @@ interface RecreationResource { description: string; site_location: string; recreation_activity: RecreationActivityWithDescription[]; + rec_resource_type: string; recreation_status: { recreation_status_code: { description: string; @@ -36,6 +37,7 @@ export class RecreationResourceService { description: true, name: true, site_location: true, + rec_resource_type: true, recreation_activity: { select: { diff --git a/frontend/src/components/layout/PageMenu.scss b/frontend/src/components/layout/PageMenu.scss index c581598f..d5c5c935 100644 --- a/frontend/src/components/layout/PageMenu.scss +++ b/frontend/src/components/layout/PageMenu.scss @@ -13,6 +13,12 @@ @media (min-width: $mdBreakpoint) { position: sticky; position: -webkit-sticky; + background-color: #fff; + z-index: 100; + } + + @media (max-width: $lgBreakpoint) { + max-width: 100%; } .navbar { diff --git a/frontend/src/components/rec-resource/RecResourcePage.tsx b/frontend/src/components/rec-resource/RecResourcePage.tsx index 198ded2a..d87ee9a4 100644 --- a/frontend/src/components/rec-resource/RecResourcePage.tsx +++ b/frontend/src/components/rec-resource/RecResourcePage.tsx @@ -17,6 +17,7 @@ import locationDot from '@/images/fontAwesomeIcons/location-dot.svg'; import '@/components/rec-resource/RecResource.scss'; import { RecreationResourceDto } from '@/service/recreation-resource'; import { useRecreationResourceApi } from '@/service/hooks/useRecreationResourceApi'; +import { mapRecreationFeatureCode } from '@/utils/mapRecreationFeatureCode'; export const photosExample = [ { @@ -75,6 +76,7 @@ const RecResourcePage = () => { name, rec_resource_id, site_location, + rec_resource_type, recreation_status: { status_code: statusCode, description: statusDescription, @@ -133,7 +135,8 @@ const RecResourcePage = () => {

{formattedName}

- Recreation site | {rec_resource_id} + {mapRecreationFeatureCode(rec_resource_type!)} |{' '} + {rec_resource_id}

diff --git a/frontend/src/service/recreation-resource/models/RecreationResourceDto.ts b/frontend/src/service/recreation-resource/models/RecreationResourceDto.ts index 4a4adb9e..cf84037b 100644 --- a/frontend/src/service/recreation-resource/models/RecreationResourceDto.ts +++ b/frontend/src/service/recreation-resource/models/RecreationResourceDto.ts @@ -70,6 +70,8 @@ export interface RecreationResourceDto { * @memberof RecreationResourceDto */ recreation_status: RecreationStatusDto; + + rec_resource_type: string; } /** @@ -116,6 +118,7 @@ export function RecreationResourceDtoFromJSONTyped( name: json['name'], description: json['description'], site_location: json['site_location'], + rec_resource_type: json['rec_resource_type'], recreation_activity: (json['recreation_activity'] as Array).map( RecreationActivityDtoFromJSON, ), diff --git a/frontend/src/utils/mapRecreationFeatureCode.test.ts b/frontend/src/utils/mapRecreationFeatureCode.test.ts new file mode 100644 index 00000000..91f49e22 --- /dev/null +++ b/frontend/src/utils/mapRecreationFeatureCode.test.ts @@ -0,0 +1,21 @@ +import { mapRecreationFeatureCode } from './mapRecreationFeatureCode'; + +describe('mapRecreationFeatureCode', () => { + it('should return correct description for known codes', () => { + expect(mapRecreationFeatureCode('RTR')).toBe('Recreation Trail'); + expect(mapRecreationFeatureCode('SIT')).toBe('Recreation Site'); + expect(mapRecreationFeatureCode('RR')).toBe('Recreation Reserve'); + expect(mapRecreationFeatureCode('IF')).toBe('Interpretive Forest'); + }); + + it('should return "Unknown Feature" for unknown codes', () => { + expect(mapRecreationFeatureCode('XYZ')).toBe('Unknown Feature'); + expect(mapRecreationFeatureCode('')).toBe('Unknown Feature'); + expect(mapRecreationFeatureCode('123')).toBe('Unknown Feature'); + }); + + it('should handle case sensitivity correctly', () => { + expect(mapRecreationFeatureCode('rtr')).toBe('Unknown Feature'); + expect(mapRecreationFeatureCode('sit')).toBe('Unknown Feature'); + }); +}); diff --git a/frontend/src/utils/mapRecreationFeatureCode.ts b/frontend/src/utils/mapRecreationFeatureCode.ts new file mode 100644 index 00000000..87c9a277 --- /dev/null +++ b/frontend/src/utils/mapRecreationFeatureCode.ts @@ -0,0 +1,14 @@ +enum RecreationFeatureCode { + RTR = 'Recreation Trail', + SIT = 'Recreation Site', + RR = 'Recreation Reserve', + IF = 'Interpretive Forest', +} + +const recreationFeatureMap = new Map( + Object.entries(RecreationFeatureCode), +); + +export const mapRecreationFeatureCode = (code: string): string => { + return recreationFeatureMap.get(code) ?? 'Unknown Feature'; +}; diff --git a/migrations/fixtures/sql/V1.0.0__recreation_resource.sql b/migrations/fixtures/sql/V1.0.0__recreation_resource.sql index eaefbab2..2a85f597 100644 --- a/migrations/fixtures/sql/V1.0.0__recreation_resource.sql +++ b/migrations/fixtures/sql/V1.0.0__recreation_resource.sql @@ -1,53 +1,53 @@ -insert into rst.recreation_resource (rec_resource_id, name, description, site_location, display_on_public_site) +insert into rst.recreation_resource (rec_resource_id, name, description, site_location, display_on_public_site, rec_resource_type) values -('REC204117', '0 K SNOWMOBILE PARKING LOT', 'The Zero K Tulameen Snowmobile Parking Lot is an area managed for snowmobilers who use the Mt. Henning and 10 K Area Snowmobile Trails in the vicinity. The parking lot and the trail network it supports is managed under a partnership agreement with the Coquihalla Summit Snowmobile Club during the snowmobile season and has an informative kiosk, outhouse and fee collection hut complete with a heated change room. Fees are applicable for the use of the snowmobile trails which are frequently groomed.', 'MERRITT', true), -('REC1222', '100 ROAD BRIDGE', 'Site not currently being managed. Pending disestablishment (Jan 2009) - Sept 2021 Update: Site should have updated inspection. Site was never disestablished and is well used by the public.', 'PRINCE GEORGE', true), -('REC160773', '10K CABIN', 'This snowmobile emergency cabin is located north of Coquihalla Mountain and is accessed via the Mt. Henning and 10 k Area Snowmobile Trails. The cabin is maintained under management agreement with the Coquihalla Summit Snowmobile Club and is intended for emergency use only. Please respect this cabin by keeping it clean and vandalism free. An avalanche terrain map and trail map is located within the cabin to advise snowmobilers of the types of avalanche terrain encountered in the area and the avalanche danger rating system.', 'MERRITT', true), -('REC203239', '10 K SNOWMOBILE PARKING LOT', 'A 1 hectare gravel parking lot located at 10.2 km of the Tulameen Forest Service Road. Managed in partnership with the Coquihalla Summit Snowmobile Club this parking lot can be used by sledders who generally access the Coquihalla Mountain area near where the 10 k Cabin is located. The parking lot may be ploughed some winter seasons while other seasons it will not be ploughed depending upon whether the industrial road is being used and machinery can then access the lot for ploughing. Best to check the club website for more details at Coqsnow.com', 'MERRITT', true), -('REC6866', '1861 GOLDRUSH PACK TRAIL', 'Come and hike the original route used by Goldrush miners as they travelled overland from the Coast into the Goldfields of the Barkerville area. The trailhead is in Barkerville and travels up and over Yanks Peak (French Snowshoe Mountain) and down to Weaver Creek where it joins the current road system. There are numerous historic sites along the trail as well as several rustic campsites. Visit www.barkerville.bc.ca for more details. Non Motorized Use Only', 'WELLS', true), -('REC203900', '18 Mile', '18 mile camping area sits at an elevation +/- 587 meters on Revelstoke Lake with changing shore lines, Revelstoke Lake is a lake created by hydro electric power generation.', 'REVELSTOKE', true), -('REC160432', '24 KM SHELTER', 'An area set aside for any future snowmobile parking lot or shelter location which is currently managed under a snowmobile trail maintenance agreement with the Merritt Snowmobile Club. Currently has only an outhouse on location.', 'MERRITT', true), -('REC6739', '24 MILE SNOWMOBILE AREA', 'The West Kootenay Snow Goers manage about 30 Km of groomed trail in the area with 2 day use warming huts. The groomed trails are easy riding and the whole area is generally for beginner to moderate sledding skills with some areas of advanced terrain around the Mount Shields area.', 'CASTLEGAR', true), -('REC16158', '27 Swithbacks', 'Forested Mtn Bike', 'WHISTLER', true), -('REC2094', '40 Mile CAMP / BULL River', 'A small scenic site at the confluence of Quinn Creek and the Bull River.', 'FERNIE', true), -('REC6897', '70 Mile Green Lake Trail', 'The trail starts at 70 Mile House BC and connects to a vast network of snowmobile and ATV trails around south Green Lake. From 70 Mile House, it is also possible to connect to the Gold Rush Recreation Trail, allowing users to travel as far north as Horsefly, and as far south as Clinton.', '70 MILE HOUSE', true), -('REC2206', '7 MILE LAKE', 'This is a small site, semi-forested with mature Larch and Lodgepole Pine trees, with a central grassy, open area. Most of the sites are well-shaded, as the recreation site is nestled in a valley bottom. The site is located adjacent to Seven Mile Lake, a small shallow, weedy lake which is the headwaters of Caven Creek. The lake has a steep shoreline and is treed right to the water on the south shore, but a rough trail along the north side of the lake provides access to the deeper portion of the lake which is suitable for fishing. The lake is stocked with Cutthroat trout every other year. The site is located right on the main FSR but traffic is not excessive at this point.', 'CRANBROOK', true), -('REC206043', '8 Mile Cabin Telegraph Trail', 'These are historic cabin/shelters sites, and may not be an actual functioning shelter.', 'Bob Quinn Lake', true), -('REC166903', '99 Mile Cross-Country Ski Trails', 'The 99 Mile Cross Country Ski Trails are groomed and maintained by the 100 Mile Nordic Ski Society. Please visit their website at 100 Mile Nordics for more information regarding seasons passes, day passes, lodge operating hours, and ski conditions. The trail network boasts 45 km of groomed ski trails, 5 km of lit trails for night skiing and 6.5 km of snowshoe trails.', '100 MILE HOUSE', true), -('REC32013', '99 Mile Mountain Bike Trails', 'These trails wind their way through stands of Douglas-fir and lodgepole pine above the community of 100 Mile House. The 99 Mile Hill is home to several trail networks for a variety of recreation activities, including cross-country skiing, snowmobiling, and horseback riding. The area also provides opportunities for the public to tour through a demonstration forest with interpretative signs.', '100 MILE HOUSE', true), -('REC261475', '99 Mile Off Road Motorcycle', 'off-road motorcycle trails (singletrack)', '100 MILE HOUSE', true), -('REC166942', '99 Mile Parking Oval', 'This is a parking area for those enjoying the recreation trails.', '100 Mile House', true), -('REC2792', '99 MILE SKI TRAILS', 'These Trails are a short Drive outside of 100 Mile house', '100 Mile House', true), -('REC230522', '99 Mile Snowshoe Trails', 'These snowshoe trails are near the 99 Mile Cross Country Ski Trails network. There are 2 snowshoe trail loops available: the Bear Paw trail and the Beanstalk Cabin trail. The Bear Paw trail is the shorter and easier loop, while the Beanstalk Cabin trail is the longer and more challenging trail. Please do not walk or snowshoe along the set cross-country ski trails in the area.', '100 MILE HOUSE', true), -('REC205035', '99 Mile XC Keene Road Parking', 'Parking area', '100 Mile House', true), -('REC2566', 'ABBOTT CREEK', 'Looking for sun on the beach? Abbott Creek is the spot. A mid-sized rec site along the North Shore of Quesnel Lake with the majority of the sites set back in the shade of the Cottonwood trees along the large gravel beach. Boat launch is across the beach, 4x4 may be required. This also makes an excellent spot to start a boat trip on Quesnel Lake. Please park in the upper parking area and not a campsite if you intend to be away from the site for an extended period.', 'LIKELY', true), -('REC1735', 'ABBOTT LAKE', 'This small 3 vehicle somewhat remote recreation site is located in a semi open area on the north east side of Abbott Lake and is popular for fishing and boating. The camping spots are suitable for small truck campers and tenters and not for anything towed due to the rough access.', 'MERRITT', true), -('REC2978', 'ABBOTT LAKE TRAIL', 'This is a 400m access trail to the south shore of Abbott Lake. There are no facilities other than a parking area off of the Horsefly Road. There is no boat launching access via this trail.', 'HORSEFLY', true), -('REC136003', 'Aberdeen Columns', 'Aberdeen Columns is a climbing area in central BC. The Basalt columns are an ancient artifact of volcanic activity long ago over the Aberdeen plateau. Rock climbing is a dangerous activity carrying a significant risk to your personal safety and should be undertaken with a full understanding of all inherent risks.', 'LAVINGTON', true), -('REC265901', 'Aberdeen Columns Trail', 'Aberdeen columns are basalt rock formations. The Okanagan valley formed 60 million years ago as a result from a rift. 40 million years ago the valley was a wash with gushing volcanoes. Some of which are Knox Mountain, Dilworth and Mount Boucherie. The valley didn''t exist when dinosaurs roamed the earth. The result today is a popular climbing area.', 'LAVINGTON', true), -('REC1585', 'ABERDEEN LAKE', 'This semi-open site on a medium sized fishing lake is subject to significant water level fluctuations. The access is very rough for 2 km before the site.', 'LAVINGTON', true), -('REC262200', 'Aberdeen Snowshoe', NULL, 'LAVINGTON', true), -('REC265549', 'Aberdeen Snowshoe Trails', 'Snowshoe and hiking trails, XC trails short drive from Lavington BC', 'LUMBY', true), -('REC270155', 'Abiotic Factor', 'Forested Trail', 'SILVERTON', true), -('REC0587', 'AGATE POINT', 'A small day-use site with 3 tables and 1 outhouse. Located on the north shore of Tchesinkut Lake.', 'BURNS LAKE', true), -('REC166367', 'Agnes Lake Trail', 'This trail provides access to a small secluded lake with excellent fishing. Agnes Lake is situated in a lodgepole pine & spruce forest in the foothills of the Coast Range of mountains at an elevation of 1300 m. The trail is only 600 m long and provides easy access to Agnes Lake. Travel time is about 15 minutes by foot. There are no facilities at the lake. The trail and surrounding area was heavily impacted by wildfire in 2017, but the trail has been cleared and marked with trail markers in September of 2019.', 'TATLA LAKE', true), -('REC1621', 'AGUR LAKE', 'Agur Lake is a small lake West of Summerland. The shores of the lake are marshy.', 'SUMMERLAND', true), -('REC1164', 'AHBAU LAKE', 'This semi-remote site is located on the northern shores of beautiful Ahbau Lake, near the border of the Prince George and Quesnel Forest Districts. This site has camping pads to accommodate 10 larger units as well as another 10 smaller sites on the upper loop road. There is access to a lake via a concrete boat launch. The lake is popular for kayaking and boating, and offers opportunities for angling of wild fish (rainbow trout and coarse fish species). The site offers the basic amenities of fire rings, tables and pit toilets.', 'QUESNEL', true), -('REC5763', 'AHDATAY', 'Sand beach, boat access only, user maintained.', 'FORT ST. JAMES', true), -('REC4519', 'AILEEN LAKE', 'This site is on a small fishing lake. There is 1 table and outhouse on site. Access is poor and requires a 4wd vehicle. Campers and trailers will have a difficult time getting into Aileen Lake due to water bars along the roads through cutblocks, and large water puddles and the ingrown forest for the last 800m. Best suited for the day fisherman in a pickup truck.', 'WINFIELD', true), -('REC265446', 'Airy Area', 'Wilderness area, alpine hiking', 'SLOCAN', true), -('REC262362', 'Aitken Falls', 'Water falls', 'HOUSTON', true), -('REC192109', 'Alamo Hiking Trail', 'Are trails at the base of Idaho Peak with an elevation 2282 m / 7486 ft. The trail winds its way through forested areas.', 'NEW DENVER', true), -('REC204480', 'Albright Trail', 'Albright Trail', 'Tumbler Ridge', true), -('REC0180', 'ALDER GROVE', 'A small shady site on an old railgrade with a short trail to the lakeshore.', 'CAMPBELL RIVER', true), -('REC97746', 'Aldridge Creek Trail', 'In conjunction with the Great Divide Trail and the Hornaday Wilderness Society, the trail was rebuilt in 2015.', 'ELKFORD', true), -('REC2047', 'ALDRIDGE CR WEST', 'A small, heavily treed site on the Elk River.', 'ELKFORD', true), -('REC2054', 'ALEXANDER CK #1', 'A small, partially treed site on Alexander Creek.', 'SPARWOOD', true), -('REC0108', 'ALEXANDER CREEK', 'A small, partly treed site.', 'SPARWOOD', true), -('REC13876', 'ALFRED LAKE', 'A small and remote lake, surrounded by trees, with a boat launch.', 'POWELL RIVER', true), -('REC1605', 'ALPINE LAKE', 'A small, scenic lake with fishing opportunities.', 'PENTICTON', true), -('REC1163', 'ALPINE LAKE TRAIL', 'A short but steep hike through alpine meadows to the scenic Alpine Lake.', 'TROUT CREEK', true), -('REC5973', 'ALTA LAKE', 'A small mountain lake in Whistler', 'WHISTLER', true), -('REC1298', 'ALTA LAKE PARKING LOT', 'A parking area for the nearby Alta Lake Trail.', 'WHISTLER', true), -('REC5951', 'ALTA LAKE TRAIL', 'A trail that runs along the shore of Alta Lake, offering scenic views.', 'WHISTLER', true), -('REC3176', 'ALTA SNOWMOBILE PARKING LOT', 'A snowmobile parking area located off Alta Lake Road.', 'WHISTLER', true); +('REC204117', '0 K SNOWMOBILE PARKING LOT', 'The Zero K Tulameen Snowmobile Parking Lot is an area managed for snowmobilers who use the Mt. Henning and 10 K Area Snowmobile Trails in the vicinity. The parking lot and the trail network it supports is managed under a partnership agreement with the Coquihalla Summit Snowmobile Club during the snowmobile season and has an informative kiosk, outhouse and fee collection hut complete with a heated change room. Fees are applicable for the use of the snowmobile trails which are frequently groomed.', 'MERRITT', true, 'RTR'), +('REC1222', '100 ROAD BRIDGE', 'Site not currently being managed. Pending disestablishment (Jan 2009) - Sept 2021 Update: Site should have updated inspection. Site was never disestablished and is well used by the public.', 'PRINCE GEORGE', true, 'RTR'), +('REC160773', '10K CABIN', 'This snowmobile emergency cabin is located north of Coquihalla Mountain and is accessed via the Mt. Henning and 10 k Area Snowmobile Trails. The cabin is maintained under management agreement with the Coquihalla Summit Snowmobile Club and is intended for emergency use only. Please respect this cabin by keeping it clean and vandalism free. An avalanche terrain map and trail map is located within the cabin to advise snowmobilers of the types of avalanche terrain encountered in the area and the avalanche danger rating system.', 'MERRITT', true, 'RTR'), +('REC203239', '10 K SNOWMOBILE PARKING LOT', 'A 1 hectare gravel parking lot located at 10.2 km of the Tulameen Forest Service Road. Managed in partnership with the Coquihalla Summit Snowmobile Club this parking lot can be used by sledders who generally access the Coquihalla Mountain area near where the 10 k Cabin is located. The parking lot may be ploughed some winter seasons while other seasons it will not be ploughed depending upon whether the industrial road is being used and machinery can then access the lot for ploughing. Best to check the club website for more details at Coqsnow.com', 'MERRITT', true, 'RTR'), +('REC6866', '1861 GOLDRUSH PACK TRAIL', 'Come and hike the original route used by Goldrush miners as they travelled overland from the Coast into the Goldfields of the Barkerville area. The trailhead is in Barkerville and travels up and over Yanks Peak (French Snowshoe Mountain) and down to Weaver Creek where it joins the current road system. There are numerous historic sites along the trail as well as several rustic campsites. Visit www.barkerville.bc.ca for more details. Non Motorized Use Only', 'WELLS', true, 'RTR'), +('REC203900', '18 Mile', '18 mile camping area sits at an elevation +/- 587 meters on Revelstoke Lake with changing shore lines, Revelstoke Lake is a lake created by hydro electric power generation.', 'REVELSTOKE', true, 'RTR'), +('REC160432', '24 KM SHELTER', 'An area set aside for any future snowmobile parking lot or shelter location which is currently managed under a snowmobile trail maintenance agreement with the Merritt Snowmobile Club. Currently has only an outhouse on location.', 'MERRITT', true, 'RTR'), +('REC6739', '24 MILE SNOWMOBILE AREA', 'The West Kootenay Snow Goers manage about 30 Km of groomed trail in the area with 2 day use warming huts. The groomed trails are easy riding and the whole area is generally for beginner to moderate sledding skills with some areas of advanced terrain around the Mount Shields area.', 'CASTLEGAR', true, 'RTR'), +('REC16158', '27 Swithbacks', 'Forested Mtn Bike', 'WHISTLER', true, 'RTR'), +('REC2094', '40 Mile CAMP / BULL River', 'A small scenic site at the confluence of Quinn Creek and the Bull River.', 'FERNIE', true, 'RR'), +('REC6897', '70 Mile Green Lake Trail', 'The trail starts at 70 Mile House BC and connects to a vast network of snowmobile and ATV trails around south Green Lake. From 70 Mile House, it is also possible to connect to the Gold Rush Recreation Trail, allowing users to travel as far north as Horsefly, and as far south as Clinton.', '70 MILE HOUSE', true, 'RR'), +('REC2206', '7 MILE LAKE', 'This is a small site, semi-forested with mature Larch and Lodgepole Pine trees, with a central grassy, open area. Most of the sites are well-shaded, as the recreation site is nestled in a valley bottom. The site is located adjacent to Seven Mile Lake, a small shallow, weedy lake which is the headwaters of Caven Creek. The lake has a steep shoreline and is treed right to the water on the south shore, but a rough trail along the north side of the lake provides access to the deeper portion of the lake which is suitable for fishing. The lake is stocked with Cutthroat trout every other year. The site is located right on the main FSR but traffic is not excessive at this point.', 'CRANBROOK', true, 'RR'), +('REC206043', '8 Mile Cabin Telegraph Trail', 'These are historic cabin/shelters sites, and may not be an actual functioning shelter.', 'Bob Quinn Lake', true, 'RTR'), +('REC166903', '99 Mile Cross-Country Ski Trails', 'The 99 Mile Cross Country Ski Trails are groomed and maintained by the 100 Mile Nordic Ski Society. Please visit their website at 100 Mile Nordics for more information regarding seasons passes, day passes, lodge operating hours, and ski conditions. The trail network boasts 45 km of groomed ski trails, 5 km of lit trails for night skiing and 6.5 km of snowshoe trails.', '100 MILE HOUSE', true, 'RTR'), +('REC32013', '99 Mile Mountain Bike Trails', 'These trails wind their way through stands of Douglas-fir and lodgepole pine above the community of 100 Mile House. The 99 Mile Hill is home to several trail networks for a variety of recreation activities, including cross-country skiing, snowmobiling, and horseback riding. The area also provides opportunities for the public to tour through a demonstration forest with interpretative signs.', '100 MILE HOUSE', true, 'RTR'), +('REC261475', '99 Mile Off Road Motorcycle', 'off-road motorcycle trails (singletrack)', '100 MILE HOUSE', true, 'RTR'), +('REC166942', '99 Mile Parking Oval', 'This is a parking area for those enjoying the recreation trails.', '100 Mile House', true, 'RTR'), +('REC2792', '99 MILE SKI TRAILS', 'These Trails are a short Drive outside of 100 Mile house', '100 Mile House', true, 'RTR'), +('REC230522', '99 Mile Snowshoe Trails', 'These snowshoe trails are near the 99 Mile Cross Country Ski Trails network. There are 2 snowshoe trail loops available: the Bear Paw trail and the Beanstalk Cabin trail. The Bear Paw trail is the shorter and easier loop, while the Beanstalk Cabin trail is the longer and more challenging trail. Please do not walk or snowshoe along the set cross-country ski trails in the area.', '100 MILE HOUSE', true, 'RTR'), +('REC205035', '99 Mile XC Keene Road Parking', 'Parking area', '100 Mile House', true, 'RTR'), +('REC2566', 'ABBOTT CREEK', 'Looking for sun on the beach? Abbott Creek is the spot. A mid-sized rec site along the North Shore of Quesnel Lake with the majority of the sites set back in the shade of the Cottonwood trees along the large gravel beach. Boat launch is across the beach, 4x4 may be required. This also makes an excellent spot to start a boat trip on Quesnel Lake. Please park in the upper parking area and not a campsite if you intend to be away from the site for an extended period.', 'LIKELY', true, 'RTR'), +('REC1735', 'ABBOTT LAKE', 'This small 3 vehicle somewhat remote recreation site is located in a semi open area on the north east side of Abbott Lake and is popular for fishing and boating. The camping spots are suitable for small truck campers and tenters and not for anything towed due to the rough access.', 'MERRITT', true, 'RTR'), +('REC2978', 'ABBOTT LAKE TRAIL', 'This is a 400m access trail to the south shore of Abbott Lake. There are no facilities other than a parking area off of the Horsefly Road. There is no boat launching access via this trail.', 'HORSEFLY', true, 'RTR'), +('REC136003', 'Aberdeen Columns', 'Aberdeen Columns is a climbing area in central BC. The Basalt columns are an ancient artifact of volcanic activity long ago over the Aberdeen plateau. Rock climbing is a dangerous activity carrying a significant risk to your personal safety and should be undertaken with a full understanding of all inherent risks.', 'LAVINGTON', true, 'RTR'), +('REC265901', 'Aberdeen Columns Trail', 'Aberdeen columns are basalt rock formations. The Okanagan valley formed 60 million years ago as a result from a rift. 40 million years ago the valley was a wash with gushing volcanoes. Some of which are Knox Mountain, Dilworth and Mount Boucherie. The valley didn''t exist when dinosaurs roamed the earth. The result today is a popular climbing area.', 'LAVINGTON', true, 'RTR'), +('REC1585', 'ABERDEEN LAKE', 'This semi-open site on a medium sized fishing lake is subject to significant water level fluctuations. The access is very rough for 2 km before the site.', 'LAVINGTON', true, 'RTR'), +('REC262200', 'Aberdeen Snowshoe', NULL, 'LAVINGTON', true, 'RTR'), +('REC265549', 'Aberdeen Snowshoe Trails', 'Snowshoe and hiking trails, XC trails short drive from Lavington BC', 'LUMBY', true, 'SIT'), +('REC270155', 'Abiotic Factor', 'Forested Trail', 'SILVERTON', true, 'SIT'), +('REC0587', 'AGATE POINT', 'A small day-use site with 3 tables and 1 outhouse. Located on the north shore of Tchesinkut Lake.', 'BURNS LAKE', true, 'SIT'), +('REC166367', 'Agnes Lake Trail', 'This trail provides access to a small secluded lake with excellent fishing. Agnes Lake is situated in a lodgepole pine & spruce forest in the foothills of the Coast Range of mountains at an elevation of 1300 m. The trail is only 600 m long and provides easy access to Agnes Lake. Travel time is about 15 minutes by foot. There are no facilities at the lake. The trail and surrounding area was heavily impacted by wildfire in 2017, but the trail has been cleared and marked with trail markers in September of 2019.', 'TATLA LAKE', true, 'SIT'), +('REC1621', 'AGUR LAKE', 'Agur Lake is a small lake West of Summerland. The shores of the lake are marshy.', 'SUMMERLAND', true, 'RTR'), +('REC1164', 'AHBAU LAKE', 'This semi-remote site is located on the northern shores of beautiful Ahbau Lake, near the border of the Prince George and Quesnel Forest Districts. This site has camping pads to accommodate 10 larger units as well as another 10 smaller sites on the upper loop road. There is access to a lake via a concrete boat launch. The lake is popular for kayaking and boating, and offers opportunities for angling of wild fish (rainbow trout and coarse fish species). The site offers the basic amenities of fire rings, tables and pit toilets.', 'QUESNEL', true, 'RTR'), +('REC5763', 'AHDATAY', 'Sand beach, boat access only, user maintained.', 'FORT ST. JAMES', true, 'RTR'), +('REC4519', 'AILEEN LAKE', 'This site is on a small fishing lake. There is 1 table and outhouse on site. Access is poor and requires a 4wd vehicle. Campers and trailers will have a difficult time getting into Aileen Lake due to water bars along the roads through cutblocks, and large water puddles and the ingrown forest for the last 800m. Best suited for the day fisherman in a pickup truck.', 'WINFIELD', true, 'RTR'), +('REC265446', 'Airy Area', 'Wilderness area, alpine hiking', 'SLOCAN', true, 'RTR'), +('REC262362', 'Aitken Falls', 'Water falls', 'HOUSTON', true, 'RTR'), +('REC192109', 'Alamo Hiking Trail', 'Are trails at the base of Idaho Peak with an elevation 2282 m / 7486 ft. The trail winds its way through forested areas.', 'NEW DENVER', true, 'RTR'), +('REC204480', 'Albright Trail', 'Albright Trail', 'Tumbler Ridge', true, 'IF'), +('REC0180', 'ALDER GROVE', 'A small shady site on an old railgrade with a short trail to the lakeshore.', 'CAMPBELL RIVER', true, 'IF'), +('REC97746', 'Aldridge Creek Trail', 'In conjunction with the Great Divide Trail and the Hornaday Wilderness Society, the trail was rebuilt in 2015.', 'ELKFORD', true, 'IF'), +('REC2047', 'ALDRIDGE CR WEST', 'A small, heavily treed site on the Elk River.', 'ELKFORD', true, 'IF'), +('REC2054', 'ALEXANDER CK #1', 'A small, partially treed site on Alexander Creek.', 'SPARWOOD', true, 'IF'), +('REC0108', 'ALEXANDER CREEK', 'A small, partly treed site.', 'SPARWOOD', true, 'IF'), +('REC13876', 'ALFRED LAKE', 'A small and remote lake, surrounded by trees, with a boat launch.', 'POWELL RIVER', true, 'RTR'), +('REC1605', 'ALPINE LAKE', 'A small, scenic lake with fishing opportunities.', 'PENTICTON', true, 'RTR'), +('REC1163', 'ALPINE LAKE TRAIL', 'A short but steep hike through alpine meadows to the scenic Alpine Lake.', 'TROUT CREEK', true, 'RTR'), +('REC5973', 'ALTA LAKE', 'A small mountain lake in Whistler', 'WHISTLER', true, 'RTR'), +('REC1298', 'ALTA LAKE PARKING LOT', 'A parking area for the nearby Alta Lake Trail.', 'WHISTLER', true, 'RTR'), +('REC5951', 'ALTA LAKE TRAIL', 'A trail that runs along the shore of Alta Lake, offering scenic views.', 'WHISTLER', true, 'RTR'), +('REC3176', 'ALTA SNOWMOBILE PARKING LOT', 'A snowmobile parking area located off Alta Lake Road.', 'WHISTLER', true, 'RR'); diff --git a/migrations/fta/sql/V1.0.2__fta_to_rst.sql b/migrations/fta/sql/V1.0.2__fta_to_rst.sql index 5b91f66a..4c655ed6 100644 --- a/migrations/fta/sql/V1.0.2__fta_to_rst.sql +++ b/migrations/fta/sql/V1.0.2__fta_to_rst.sql @@ -1,4 +1,4 @@ -insert into rst.recreation_resource (rec_resource_id, name, description, site_location, display_on_public_site) +insert into rst.recreation_resource (rec_resource_id, name, description, site_location, display_on_public_site, rec_resource_type) select rp.forest_file_id, rp.project_name as name, @@ -10,13 +10,18 @@ select case when rp.recreation_view_ind = 'Y' then true else false - end as display_on_public_site + end as display_on_public_site, + rmf.recreation_map_feature_code from fta.recreation_project rp left join fta.recreation_comment rc on rp.forest_file_id = rc.forest_file_id +left join + fta.recreation_map_feature rmf +on + rp.forest_file_id = rmf.forest_file_id on conflict do nothing; insert into rst.recreation_activity_code (recreation_activity_code, description) diff --git a/migrations/rst/sql/V1.0.0__init.sql b/migrations/rst/sql/V1.0.0__init.sql index f31391d3..0b5e5a9d 100644 --- a/migrations/rst/sql/V1.0.0__init.sql +++ b/migrations/rst/sql/V1.0.0__init.sql @@ -7,7 +7,8 @@ create table if not exists rst.recreation_resource ( name varchar(200), description varchar(5000), site_location varchar(200), - display_on_public_site boolean default false + display_on_public_site boolean default false, + rec_resource_type varchar(50) ); comment on table rst.recreation_resource is 'Resource information relating to a recreational file. A recreation file can have only one resource. A recreation resource must be of type Site, Reserve, Trail, or Interpretive Forest.'; @@ -18,6 +19,8 @@ comment on column rst.recreation_resource.name is 'Name of the Recreation Projec comment on column rst.recreation_resource.site_location is 'A text description generally describing the closest community or, for more isolated sites and trails, it could be a geographic feature to a recreation site or trail. e.g. VERNON, KELOWNA, PRINCE GEORGE.'; +comment on column rst.recreation_resource.rec_resource_type is 'Code representing a specific feature associated with the recreation resource.'; + create table rst.recreation_activity_code ( recreation_activity_code varchar(3) primary key, description varchar(120)