Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WTW_NAT_SPECIES_METADATA.xlsx: Protected_Km2, Pct_Protected #1

Open
DanWismer opened this issue Oct 7, 2024 · 7 comments
Open

WTW_NAT_SPECIES_METADATA.xlsx: Protected_Km2, Pct_Protected #1

DanWismer opened this issue Oct 7, 2024 · 7 comments
Labels
invalid This doesn't seem right

Comments

@DanWismer
Copy link

DanWismer commented Oct 7, 2024

The Protected_Km2 and Pct_Protected are likely out dated from when I first built those columns in summer 2023:
https://github.com/NCC-CNC/wtw-species-prep/blob/main/R/species_metadata.R

These columns are not needed for WTW or wtw-data-prep and I was thinking of dropping them in the WTW_NAT_SPECIES_METADATA.
Or
I can revisit that wtw-species-prep and do some updates. It should only be a matter of rerunning with the updated includes data. The species data hasn't changed.

Do you think calculating the species total_km2, Protected_km2, and Pct_protected should be in the ERAP workflow?

https://github.com/NCC-CNC/erap_code/blob/653ca1934529af10806de514e1627579fc4f18fe/5c_species_extractions.R#L46-L50

@DanWismer DanWismer added the invalid This doesn't seem right label Oct 7, 2024
@edwardsmarc
Copy link
Contributor

I think those columns would be good to keep in the ERAPs. At least in the short term. If it makes sense we could incorporate that code into the ERAP workflow by adding a script that calculates the columns. That way you could drop it from the species prep repo and we just run it once a year when the ERAPs get refreshed.

I know the original calculations ran on the raw vector layers for ECCC data. We could consider just running it on the 1km raster data so it matches how I calculate the ecoregion values.

@ricschuster
Copy link

I am surprised that Protected_Km2 and Pct_Protected would not be calculated or used for each WTW project. Are those values not used to show % protected in the app as well as calculate the Goals? Do you use different values for that?

Also, those values should be updated regularly, at least once a year but we could even consider keeping the protected layer current through an automated process to ensure new additions to the NCC portfolio are considered when they close.

Sorry if I'm missing something here. I haven't kept up to date on this.

@DanWismer
Copy link
Author

DanWismer commented Oct 11, 2024

There is a method on the Solution Setting Class called update_current_held. This method is called to calculate how much Themes and Weights overlap with the Includes.

image

This is done when the app initializes and when you toggle includes off:
https://github.com/NCC-CNC/wheretowork/blob/37151227b074136237bdd8771ed8fff2d262cac9/R/server_import_spatial_data.R#L185-L190

WTW does all this on the fly. And for data prep, the Protected_Km2 and Pct_Protected in the WTW_NAT_SPECIES_METADATA.xlsx doesn't feed into anything. I added these as a "nice to have" if you wanted to look at this info in a spreadsheet.

Ok, sounds like we should keep these columns. I just need to make sure that they reflect the updated includes layer.

This is the script that creates WTW_NAT_SPECIES_METADATA.xlsx
https://github.com/NCC-CNC/wtw-species-prep/blob/main/R/species_metadata.R

I generated a RIJ Matrix with the 1km Existing Conservation layer. Which is CPCAD + NCC Fee Simple & NCC Conservation Agreements as a continuous Ha layer.
https://github.com/NCC-CNC/wtw-species-prep/blob/35036578114102b70a244002158c3cdfb9e82269/R/species_metadata.R#L45-L47

I then intersect the species RIJ with the continuous includes RIJ, and build out the columns.
https://github.com/NCC-CNC/wtw-species-prep/blob/35036578114102b70a244002158c3cdfb9e82269/R/species_metadata.R#L49-L88

EDIT
For ECCC CH and ECCC SAR, I intersect the vector source with the vector Existing Conservation layer to calculate numbers. For IUCN and NSC, I do the rij intersection method.

And here is where I build the Existing Conservation Layer (vector and raster). Both in Ha and as binary (50% cut off).
https://github.com/NCC-CNC/includes-rollup/blob/main/includes_rollup.py

@edwardsmarc
Copy link
Contributor

I am surprised that Protected_Km2 and Pct_Protected would not be calculated or used for each WTW project. Are those values not used to show % protected in the app as well as calculate the Goals? Do you use different values for that?

Also, those values should be updated regularly, at least once a year but we could even consider keeping the protected layer current through an automated process to ensure new additions to the NCC portfolio are considered when they close.

Sorry if I'm missing something here. I haven't kept up to date on this.

The goal column does carry through to the app here:
https://github.com/NCC-CNC/wtw-data-prep/blob/42420e998cc185894bd492c7db00f2ea4234460a/scripts/04_populate_nat_metadata.R#L293-L309

@DanWismer can you confirm that? The goal won't change unless the total range changes though because its based on the full range extent across Canada.

@DanWismer
Copy link
Author

DanWismer commented Oct 11, 2024

The Goals are calculated using the fct_calculate_targets. Where x is the Total_Km2 of the species area. All other function arguments use the default values.

Total KM2 is calculated by summing up the entire species area.
https://github.com/NCC-CNC/wtw-species-prep/blob/35036578114102b70a244002158c3cdfb9e82269/R/species_metadata.R#L116

And the Goal is then calculated by calling the fct_calculate_targets
https://github.com/NCC-CNC/wtw-species-prep/blob/35036578114102b70a244002158c3cdfb9e82269/R/species_metadata.R#L119

So the protection columns do not intersect with the Goal column. Does this make sense? Bit of a puzzle wracking my brain around it all.

edit

For wtw-data-prep and WTW, we use the pre-populated goals from WTW_NAT_SPECIES_METADATA.xlsx because we want to consider the species entire area within Canada.

If we calculated this on the fly in wtw-data-prep, we would only be calculating a Goal of the species area that intersects the AOI.

I also use WTW_NAT_SPECIES_METADATA.xlsx in wtw-data-prep to get all the common names of each species.

Yes, the goal will not change unless the Total_Km2 of the species changes. To calculate Goals, what is currently protected is not considered.

@ricschuster
Copy link

Yes, the goal will not change unless the Total_Km2 of the species changes. To calculate Goals, what is currently protected is not considered.

I would add: or the area protected across the country (that intersects the species range) changes.
So change only if species Total_Km2 changes (very unlikely) or area protected changes (happens a few times a year at least for across Canada; might not mean it affects a specific species though).

@edwardsmarc
Copy link
Contributor

Recording here that Dan and Marc decided that the national total coverage and goals should be maintained in wtw-species-prep, and the ERAPs will calculate the national protection values required for the ERAP analysis.

Moving the protection goals over to the ERAPs will be done for the 2025 release. We're out of time to incorporate this into v1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants