Working on new CREP and fallow program info
This commit is contained in:
parent
1bacd2467c
commit
d388355373
@ -18,15 +18,25 @@ CROP_LEGAL
|
||||
PARCEL_YEAR_WDID <- CROP_LEGAL %>% select(parcel_id,cal_year,gw_id1,gw_id2,gw_id3,gw_id4,gw_id5,gw_id6,gw_id7,gw_id8,gw_id9,gw_id10,gw_id11,gw_id12,gw_id13,gw_id14,gw_id15,gw_id16,gw_id17,gw_id18,gw_id19,gw_id20) %>% pivot_longer(-c("parcel_id","cal_year"),values_to="wdid") %>% select(-name) %>% filter(!is.na(wdid))
|
||||
WELL_LIST <- PARCEL_YEAR_WDID %>% pull(wdid) %>% unique
|
||||
WATER_RIGHTS <- WATER_RIGHTS %>% filter(wdid %in% WELL_LIST)
|
||||
WATER_RIGHTS
|
||||
WATER_RIGHTS %>% group_by(wdid) %>% summarize(rights_absolute=sum(rights_absolute),rights_apex=sum(rights_apex)) %>% filter(rights_absolute==0,rights_apex==0)
|
||||
|
||||
WATER_RIGHTS %>% filter(rights_absolute==0,rights_apex==0)
|
||||
read_csv("https://dwr.state.co.us/Rest/GET/api/v2/waterrights/transaction/?format=csv&wdid=2005165",skip=2)
|
||||
WATER_RIGHTS %>% filter(wdid=='2013695')
|
||||
WATER_RIGHTS
|
||||
|
||||
WATER_RIGHTS %>% mutate(
|
||||
WATER_RIGHTS %>% select(wdid,rights_absolute,rights_apex) %>% filter(rights_absolute==0,rights_apex==0)
|
||||
WATER_RIGHTS %>% filter(wdid=='2013695')%>% select(wdid,rights_absolute,rights_apex)
|
||||
WATER_RIGHTS %>% group_by(wdid) %>% mutate(total=sum(rights_absolute)+sum(rights_apex)) %>% filter(total==0) %>% arrange(wdid)
|
||||
TRANSACT <- 'https://dwr.state.co.us/Rest/GET/api/v2/waterrights/transaction/?format=csv&division=3&pageSize=500000+&apiKey=PwevUQJCStcYZfqrOYbuyztmNPlUJWby'
|
||||
TRANSACT <- read_csv(TRANSACT,skip=2)
|
||||
colnames(TRANSACT )
|
||||
TEMP <- TRANSACT %>% select(WaterRightNum,wdid,associatedWdid,planWdid,adjudicationDate,appropriationDate,totalVolumetricLimit,maxDecreedRate,comments,moreInformation)
|
||||
TEMP %>% filter(wdid=='2005005')
|
||||
TEMP %>% filter(WaterRightNum=='99984')
|
||||
%>% filter(
|
||||
WATER_RIGHTS
|
||||
WATER_RIGHTS %>% select(rights_absolute,rights_apex)
|
||||
WATER_RIGHTS
|
||||
|
||||
|
||||
37
Data/CREP_and_Fallow/CREP_Perm.csv
Normal file
37
Data/CREP_and_Fallow/CREP_Perm.csv
Normal file
@ -0,0 +1,37 @@
|
||||
wdid1,wdid2,wdid3,wdid4,wdid5
|
||||
2013956
|
||||
2005950,2005951,2005955
|
||||
2014091,2006322,2006321,2014092
|
||||
2006327,2006328
|
||||
2006325,2006326
|
||||
2006332,2006331
|
||||
2006684,2006685,2006686
|
||||
2014274,2014107,2005512,2005448
|
||||
2705248
|
||||
2005098
|
||||
2008177,2008178,2013955
|
||||
2006005,2006656,2005171,2006655
|
||||
2006323,2006324,2014088
|
||||
2008223,2008224,2008225,2014054
|
||||
2005121,2008772
|
||||
2005476,2005537,2005538,2014266
|
||||
2005769,2005770,2005771,2014270
|
||||
2005766,2005767,2005768,2014267,2014268
|
||||
2008439
|
||||
2008440,2208441
|
||||
2009992
|
||||
2009197,2014045,2014046
|
||||
2006003,2006004,2006653,2006654,2014311
|
||||
2005952,2005953,2005954
|
||||
2014309,2006334,2014080,2006333
|
||||
2006337,2006338,2014081,2014082
|
||||
2008239
|
||||
2705472
|
||||
2010499,2010500,2013906,2014178
|
||||
2006528,2006529
|
||||
2014189,2009110
|
||||
2008146,2008147,2013953
|
||||
2005665,2005664,2005666
|
||||
2005662,2005663
|
||||
2008389,2014023
|
||||
2705229
|
||||
|
54
Data/CREP_and_Fallow/CREP_Temp.csv
Normal file
54
Data/CREP_and_Fallow/CREP_Temp.csv
Normal file
@ -0,0 +1,54 @@
|
||||
wdid1,wdid2,wdid3,wdid4,wdid5
|
||||
2705126
|
||||
2705519,2706148
|
||||
2705342,2706196
|
||||
2705341,2706195
|
||||
2006478,2008677,2008678,2012887
|
||||
2005857,2008391
|
||||
2005642,2005643,2014474
|
||||
2006153,2013962
|
||||
2705318
|
||||
2012537,2014288
|
||||
2706253,2705317
|
||||
2705186,2705328
|
||||
2705054
|
||||
2008155,2008156
|
||||
2008129,2008130,2014244
|
||||
2005921,2005941,2006283,2006525
|
||||
2006335,2006336,2014086,2014087
|
||||
2706014
|
||||
2706246
|
||||
2005886,2005868
|
||||
2005595
|
||||
2013377,2013618
|
||||
2005133,2005533
|
||||
2705344
|
||||
2705067,2705068,2705523
|
||||
2705069,2705070
|
||||
2009113
|
||||
2705293
|
||||
2705290
|
||||
2705224
|
||||
2705225
|
||||
2705225
|
||||
2705224
|
||||
2705197,2705359
|
||||
2705246,2706237
|
||||
2705006,2705790
|
||||
2705184
|
||||
2705185,2705356
|
||||
2705327
|
||||
2005774,2005775
|
||||
2013784
|
||||
2705259,2705021,2705020
|
||||
2706194
|
||||
2006376,2006375
|
||||
2005127,2005168
|
||||
2705347,2706258
|
||||
2005116
|
||||
2009940,2013577
|
||||
2005038,2010590,2014490
|
||||
2705247
|
||||
2705080
|
||||
2013928,2011009
|
||||
2008191
|
||||
|
19
Data/CREP_and_Fallow/Create_CREP_Data.r
Normal file
19
Data/CREP_and_Fallow/Create_CREP_Data.r
Normal file
@ -0,0 +1,19 @@
|
||||
library(tidyverse)
|
||||
library(janitor)
|
||||
################Perm CREP contract
|
||||
CONTRACT_NUMBER <- c('ALA#3','ALA#6','ALA#7','ALA#8','ALA#9','ALA#10','ALA#12','ALA#15','SAG#6','ALA#17','ALA#18','ALA#22','ALA#23','ALA#25','RG#4','ALA#26','ALA#27','ALA#28','ALA#29','ALA#30','ALA#31','ALA#32','ALA#33','ALA#34','ALA#38','ALA#39','SAG#33','SAG#34','ALA#40','ALA#41','ALA#42','ALA#43','ALA#44','ALA#45','ALA#47','SAG#39')
|
||||
FIRST_FALLOW_YEAR <- c(2014,2014,2014,2014,2014,2014,2014,2014,2015,2015,2015,2015,2015,2015,2016,2016,2016,2016,2016,2016,2016,2016,2016,2016,2018,2018,2020,2020,2020,2020,2020,2021,2021,2021,2021,2024)
|
||||
ACRES <- c(124.9,126,119.5,119.2,121.1,118.1,122.8,67,114.1,118.6,122,121,124.66,80,149.8,110,110,110,92.9,122.3,94,123,126,126,121.28,120.5,122.8,122,118,121.84,120,120,120.01,120.1,120.11,122.94)
|
||||
CREP_PERM <- cbind(CONTRACT_NUMBER,FIRST_FALLOW_YEAR,ACRES,read_csv("CREP_Perm.csv")) %>% as_tibble %>% mutate(program='CREP',RETURN_YEAR=Inf,contract_type='Perm')
|
||||
CREP_PERM
|
||||
###############################Temp CREP contract
|
||||
CONTRACT_NUMBER <- c('SAG#1','SAG#2','SAG#3','SAG#4','RG#1','RG#2','ALA#2','ALA#11','SAG#7','SAG#8','SAG#9','SAG#10','SAG#11','ALA#16','ALA#19','ALA#21','ALA#24','SAG#12','SAG#13','RG#3','RG#7','RG#8','ALA#35','SAG#14','SAG#15','SAG#16','ALA#36','SAG#17','SAG#18','SAG#19','SAG#20','SAG#21','SAG#22','SAG#23','SAG#24','SAG#25','SAG#26','SAG#27','SAG#28','ALA#37','SAG#29','SAG#30','SAG#31','RG#9','RG#10','SAG#32','RG#11','SAG#35','SAG#36','SAG#37','SAG#38','RG#12','RG#13')
|
||||
FIRST_FALLOW_YEAR <- c(2014,2014,2014,2014,2014,2014,2014,2014,2015,2015,2015,2015,2015,2015,2015,2015,2015,2016,2016,2016,2016,2016,2016,2017,2017,2017,2017,2018,2018,2018,2018,2018,2018,2018,2018,2018,2018,2018,2018,2018,2019,2019,2019,2019,2019,2020,2022,2023,2023,2023,2023,2024,2024)
|
||||
|
||||
RETURN_YEAR <- c(2029,2029,2029,2029,2029,2029,2029,2029,2030,2030,2030,2030,2030,2030,2030,2030,2030,2031,2031,2031,2031,2031,2031,2032,2032,2032,2032,2033,2033,2033,2033,2033,2033,2033,2033,2033,2033,2033,2033,2033,2034,2034,2034,2034,2034,2035,2037,2038,2038,2038,2038,2038,2038)
|
||||
ACRES <- c(144,144,210,60,130,120.4,120,121.5,172.09,113,191,116.5,120,124,120,129,120.97,120,124,139.9,122,123.32,122,120,122.4,123.4,113.92,120,120.35,114.32,124.78,125.58,119.3,123,125.15,126.1,126.3,125.5,53.6,106,112.81,126.95,118.9,118.36,120,120,100,120,130.02,114.54,120,121.92,126.15)
|
||||
CREP_TEMP <- cbind(CONTRACT_NUMBER,FIRST_FALLOW_YEAR,RETURN_YEAR,ACRES,read_csv("CREP_Temp.csv")) %>% as_tibble %>% mutate(program='CREP',contract_type='Temp')
|
||||
CREP_TEMP %>% full_join(CREP_PERM)
|
||||
CREP_PERM
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user