NCC-CNC / wtw-species-prep

Standardizes ECCC SAR Range maps and Critical Habitat layers to the 1km grid, and more.
0 stars 0 forks source link

Species layer bugs #1

Open edwardsmarc opened 1 month ago

edwardsmarc commented 1 month ago

Found 3 ECCC layers where the values get set to objectid values due to a bug in the python prep script. Found these using:

rij_list <- c("C:/Data/PRZ/WTW_DATA/NAT_1KM/biod/RIJ_ECCC_CH.rds", 
              "C:/Data/PRZ/WTW_DATA/NAT_1KM/biod/RIJ_ECCC_SAR.rds")
rij_list2 <- c("C:/Data/PRZ/WTW_DATA/NAT_1KM/biod/RIJ_IUCN_AMPH.rds",
              "C:/Data/PRZ/WTW_DATA/NAT_1KM/biod/RIJ_IUCN_BIRD.rds",
              "C:/Data/PRZ/WTW_DATA/NAT_1KM/biod/RIJ_IUCN_MAMM.rds",
              "C:/Data/PRZ/WTW_DATA/NAT_1KM/biod/RIJ_IUCN_REPT.rds",
              "C:/Data/PRZ/WTW_DATA/NAT_1KM/biod/RIJ_NSC_END.rds",
              "C:/Data/PRZ/WTW_DATA/NAT_1KM/biod/RIJ_NSC_SAR.rds",
              "C:/Data/PRZ/WTW_DATA/NAT_1KM/biod/RIJ_NSC_SPP.rds")

for(rij in rij_list){
  x <- readRDS(rij)
  for(i in 1:length(rownames(x))){
    if(max(x[i,] > 100)){
      print(paste0(rownames(x)[i], " ----> ", max(x[i,])))
    }
  }
}
for(rij in rij_list2){
  x <- readRDS(rij)
  for(i in 1:length(rownames(x))){
    if(max(x[i,] > 1)){
      print(paste0(rownames(x)[i], " ----> ", max(x[i,])))
    }
  }
}

Layers that need fixing are:

T_NAT_ECCC_CH_END_COSEWIC_846

T_NAT_ECCC_CH_THR_COSEWIC_951

T_NAT_ECCC_SAR_NOS_COSEWIC_882

DanWismer commented 4 days ago

Thanks for flagging these layers Marc.

Looking at T_NAT_ECCC_SAR_NOS_COSEWIC_882.

The source data is an oval with 1 vertex image

When I intersect with the vector grid, it creates a bunch of these slivers and a random little oval: image

So this is whats causing the values on the edge of the range to > 100. Some double, tripping counting going on. image

I dissolve the feature, and its still giving those slivers. Really odd. Is this some weird bug in Pro?

DanWismer commented 4 days ago

I am currently using arcpy.analysis.Intersect. I tried arcpy.analysis.PairwiseIntersect and it gave the expected output

image

Still need to wrap my head around the difference between the two different intersect tools in Pro...

DanWismer commented 4 days ago

Looking at T_NAT_ECCC_CH_END_COSEWIC_846 There are two polygons that overlap. This is causing a double count to 200 ha.

This turtle has two SARA status, 3 & 2 whic must be an error in the source data? image

The recovery strategy doc says this turtle is threated (SARA 3) https://wildlife-species.canada.ca/species-risk-registry/virtual_sara/files/plans/rs_blandings_turtle_e_final.pdf

Found a few more with same COSEWIC ID but different SARA status OR different English names: CH

DanWismer commented 4 days ago

Looking at T_NAT_ECCC_CH_THR_COSEWIC_951 the Chimney swift data are tiny little circles. Likely buffers around nests?

image