Project

General

Profile

« Previous | Next » 

Revision 8172

inputs/FIA/*/map.csv: Mapped terms to VegCore

View differences:

inputs/FIA/PLOT/map.csv
1 1
FIA,VegCore,Filter,Comments
2 2
row_num,*PLOT.row_num,,
3
CN,*PLOT.CN,,
3
CN,locationID,,
4 4
SRV_CN,*PLOT.SRV_CN,,
5 5
CTY_CN,*PLOT.CTY_CN,,
6 6
PREV_PLT_CN,*PLOT.PREV_PLT_CN,,
......
8 8
STATECD,STATECD,,
9 9
UNITCD,UNITCD,,
10 10
COUNTYCD,COUNTYCD,,
11
PLOT,PLOT,,
11
PLOT,locationName,,
12 12
PLOT_STATUS_CD,*PLOT.PLOT_STATUS_CD,,
13 13
PLOT_NONSAMPLE_REASN_CD,*PLOT.PLOT_NONSAMPLE_REASN_CD,,
14
MEASYEAR,*PLOT.MEASYEAR,,
15
MEASMON,*PLOT.MEASMON,,
16
MEASDAY,*PLOT.MEASDAY,,
14
MEASYEAR,year,,
15
MEASMON,month,,
16
MEASDAY,day,,
17 17
REMPER,*PLOT.REMPER,,
18 18
KINDCD,*PLOT.KINDCD,,
19 19
DESIGNCD,*PLOT.DESIGNCD,,
20 20
RDDISTCD,*PLOT.RDDISTCD,,
21 21
WATERCD,*PLOT.WATERCD,,
22
LAT,*PLOT.LAT,,
23
LON,*PLOT.LON,,
24
ELEV,*PLOT.ELEV,,
22
LAT,decimalLatitude,,
23
LON,decimalLongitude,,
24
ELEV,elevationInMeters,,Assuming units based on the range and precision of values
25 25
GROW_TYP_CD,*PLOT.GROW_TYP_CD,,
26 26
MORT_TYP_CD,*PLOT.MORT_TYP_CD,,
27 27
P2PANEL,*PLOT.P2PANEL,,
inputs/FIA/PLOT/import
6 6
map_table
7 7
psql <<'EOF'
8 8
SELECT functions.set_col_types('"PLOT"', ARRAY[
9
  ('STATECD' , 'integer')
10
, ('UNITCD'  , 'integer')
9
  ('STATECD', 'integer')
10
, ('UNITCD', 'integer')
11 11
, ('COUNTYCD', 'integer')
12
, ('PLOT'    , 'integer')
13
, ('INVYR'   , 'integer')
12
, ('locationName', 'integer')
13
, ('INVYR', 'integer')
14 14
]::functions.col_cast[]);
15 15

  
16
SELECT functions.create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.ID"     UNIQUE ("*PLOT.CN")                                      $$);
17
SELECT functions.create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "PLOT", "INVYR")$$);
16
SELECT functions.create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.ID"     UNIQUE ("locationID")$$);
17
SELECT functions.create_if_not_exists($$ALTER TABLE "PLOT" ADD CONSTRAINT "PLOT.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR")$$);
18 18
SELECT functions.cluster_once('"PLOT"', '"PLOT.unique"');
inputs/FIA/PLOT/new_terms.csv
1 1
row_num,*PLOT.row_num,,
2
CN,*PLOT.CN,,
2
CN,locationID,,
3 3
SRV_CN,*PLOT.SRV_CN,,
4 4
CTY_CN,*PLOT.CTY_CN,,
5 5
PREV_PLT_CN,*PLOT.PREV_PLT_CN,,
6
PLOT,locationName,,
6 7
PLOT_STATUS_CD,*PLOT.PLOT_STATUS_CD,,
7 8
PLOT_NONSAMPLE_REASN_CD,*PLOT.PLOT_NONSAMPLE_REASN_CD,,
8
MEASYEAR,*PLOT.MEASYEAR,,
9
MEASMON,*PLOT.MEASMON,,
10
MEASDAY,*PLOT.MEASDAY,,
9
MEASYEAR,year,,
10
MEASMON,month,,
11
MEASDAY,day,,
11 12
REMPER,*PLOT.REMPER,,
12 13
KINDCD,*PLOT.KINDCD,,
13 14
DESIGNCD,*PLOT.DESIGNCD,,
14 15
RDDISTCD,*PLOT.RDDISTCD,,
15 16
WATERCD,*PLOT.WATERCD,,
16
LAT,*PLOT.LAT,,
17
LON,*PLOT.LON,,
18
ELEV,*PLOT.ELEV,,
17
LAT,decimalLatitude,,
18
LON,decimalLongitude,,
19
ELEV,elevationInMeters,,Assuming units based on the range and precision of values
19 20
GROW_TYP_CD,*PLOT.GROW_TYP_CD,,
20 21
MORT_TYP_CD,*PLOT.MORT_TYP_CD,,
21 22
P2PANEL,*PLOT.P2PANEL,,
inputs/FIA/PLOT/unmapped_terms.csv
1 1
*PLOT.row_num
2
*PLOT.CN
3 2
*PLOT.SRV_CN
4 3
*PLOT.CTY_CN
5 4
*PLOT.PREV_PLT_CN
......
7 6
STATECD
8 7
UNITCD
9 8
COUNTYCD
10
PLOT
11 9
*PLOT.PLOT_STATUS_CD
12 10
*PLOT.PLOT_NONSAMPLE_REASN_CD
13
*PLOT.MEASYEAR
14
*PLOT.MEASMON
15
*PLOT.MEASDAY
11
year
12
month
13
day
16 14
*PLOT.REMPER
17 15
*PLOT.KINDCD
18 16
*PLOT.DESIGNCD
19 17
*PLOT.RDDISTCD
20 18
*PLOT.WATERCD
21
*PLOT.LAT
22
*PLOT.LON
23
*PLOT.ELEV
24 19
*PLOT.GROW_TYP_CD
25 20
*PLOT.MORT_TYP_CD
26 21
*PLOT.P2PANEL
inputs/FIA/COUNTY/map.csv
3 3
STATECD,STATECD,,
4 4
UNITCD,UNITCD,,
5 5
COUNTYCD,COUNTYCD,,
6
COUNTYNM,*COUNTY.COUNTYNM,,
6
COUNTYNM,county,,
7 7
CN,*COUNTY.CN,,
8 8
CREATED_BY,*COUNTY.CREATED_BY,,
9 9
CREATED_DATE,*COUNTY.CREATED_DATE,,
inputs/FIA/COUNTY/import
6 6
map_table
7 7
psql <<'EOF'
8 8
SELECT functions.set_col_types('"COUNTY"', ARRAY[
9
  ('STATECD' , 'integer')
10
, ('UNITCD'  , 'integer')
9
  ('STATECD', 'integer')
10
, ('UNITCD', 'integer')
11 11
, ('COUNTYCD', 'integer')
12 12
]::functions.col_cast[]);
13 13

  
14
SELECT functions.create_if_not_exists($$ALTER TABLE "COUNTY" ADD CONSTRAINT "COUNTY.ID"     UNIQUE ("*COUNTY.CN")                   $$);
14
SELECT functions.create_if_not_exists($$ALTER TABLE "COUNTY" ADD CONSTRAINT "COUNTY.ID"     UNIQUE ("*COUNTY.CN")$$);
15 15
SELECT functions.create_if_not_exists($$ALTER TABLE "COUNTY" ADD CONSTRAINT "COUNTY.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD")$$);
inputs/FIA/SUBPLOT/import
6 6
map_table
7 7
psql <<'EOF'
8 8
SELECT functions.set_col_types('"SUBPLOT"', ARRAY[
9
  ('STATECD' , 'integer')
10
, ('UNITCD'  , 'integer')
9
  ('STATECD', 'integer')
10
, ('UNITCD', 'integer')
11 11
, ('COUNTYCD', 'integer')
12
, ('PLOT'    , 'integer')
13
, ('INVYR'   , 'integer')
14
, ('SUBP'    , 'integer')
12
, ('locationName', 'integer')
13
, ('INVYR', 'integer')
14
, ('subplot', 'integer')
15 15
]::functions.col_cast[]);
16 16

  
17
SELECT functions.create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.ID"     UNIQUE ("*SUBPLOT.CN")                                           $$);
18
SELECT functions.create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "PLOT", "INVYR", "SUBP")$$);
17
SELECT functions.create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.ID"     UNIQUE ("subplotID")$$);
18
SELECT functions.create_if_not_exists($$ALTER TABLE "SUBPLOT" ADD CONSTRAINT "SUBPLOT.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR", "subplot")$$);
19 19
SELECT functions.cluster_once('"SUBPLOT"', '"SUBPLOT.unique"');
inputs/FIA/SUBPLOT/unmapped_terms.csv
1 1
*SUBPLOT.row_num
2
*SUBPLOT.CN
3 2
*SUBPLOT.PLT_CN
4 3
*SUBPLOT.PREV_SBP_CN
5 4
INVYR
6 5
STATECD
7 6
UNITCD
8 7
COUNTYCD
9
PLOT
10
SUBP
11 8
*SUBPLOT.SUBP_STATUS_CD
12 9
*SUBPLOT.POINT_NONSAMPLE_REASN_CD
13 10
*SUBPLOT.MICRCOND
inputs/FIA/REF_RESEARCH_STATION/import
8 8
-- contains the research station *and state name* for each state
9 9

  
10 10
SELECT functions.set_col_types('"REF_RESEARCH_STATION"', ARRAY[
11
  ('STATECD' , 'integer')
11
  ('STATECD', 'integer')
12 12
]::functions.col_cast[]);
13 13

  
14 14
SELECT functions.create_if_not_exists($$ALTER TABLE "REF_RESEARCH_STATION" ADD CONSTRAINT "REF_RESEARCH_STATION.unique" UNIQUE ("STATECD")$$);
inputs/FIA/REF_RESEARCH_STATION/unmapped_terms.csv
2 2
STATECD
3 3
*REF_RESEARCH_STATION.RSCD
4 4
*REF_RESEARCH_STATION.RS
5
*REF_RESEARCH_STATION.STATE_NAME
6 5
*REF_RESEARCH_STATION.STATE_ABBR
7 6
*REF_RESEARCH_STATION.CREATED_BY
8 7
*REF_RESEARCH_STATION.CREATED_DATE
inputs/FIA/COUNTY/new_terms.csv
1 1
row_num,*COUNTY.row_num,,
2
COUNTYNM,*COUNTY.COUNTYNM,,
2
COUNTYNM,county,,
3 3
CN,*COUNTY.CN,,
4 4
CREATED_BY,*COUNTY.CREATED_BY,,
5 5
CREATED_DATE,*COUNTY.CREATED_DATE,,
inputs/FIA/COUNTY/unmapped_terms.csv
2 2
STATECD
3 3
UNITCD
4 4
COUNTYCD
5
*COUNTY.COUNTYNM
6 5
*COUNTY.CN
7 6
*COUNTY.CREATED_BY
8 7
*COUNTY.CREATED_DATE
inputs/FIA/REF_PLANT_DICTIONARY/map.csv
3 3
CN,*REF_PLANT_DICTIONARY.CN,,
4 4
SYMBOL_TYPE,SYMBOL_TYPE,,
5 5
SYMBOL,SYMBOL,,
6
SCIENTIFIC_NAME,*REF_PLANT_DICTIONARY.SCIENTIFIC_NAME,,
6
SCIENTIFIC_NAME,taxonName,,
7 7
NEW_SYMBOL,*REF_PLANT_DICTIONARY.NEW_SYMBOL,,
8 8
NEW_SCIENTIFIC_NAME,*REF_PLANT_DICTIONARY.NEW_SCIENTIFIC_NAME,,
9
COMMON_NAME,*REF_PLANT_DICTIONARY.COMMON_NAME,,
9
COMMON_NAME,COMMON_NAME,,
10 10
CATEGORY,*REF_PLANT_DICTIONARY.CATEGORY,,
11
FAMILY,*REF_PLANT_DICTIONARY.FAMILY,,
12
GROWTH_HABIT,*REF_PLANT_DICTIONARY.GROWTH_HABIT,,
11
FAMILY,family,,
12
GROWTH_HABIT,taxonGrowthForm,,
13 13
DURATION,*REF_PLANT_DICTIONARY.DURATION,,
14 14
US_NATIVITY,*REF_PLANT_DICTIONARY.US_NATIVITY,,
15 15
STATE_DISTRIBUTION,*REF_PLANT_DICTIONARY.STATE_DISTRIBUTION,,
16 16
STATE_AND_PROVINCE,*REF_PLANT_DICTIONARY.STATE_AND_PROVINCE,,
17
SCIENTIFIC_NAME_W_AUTHOR,*REF_PLANT_DICTIONARY.SCIENTIFIC_NAME_W_AUTHOR,,
18
GENERA_BINOMIAL_AUTHOR,*REF_PLANT_DICTIONARY.GENERA_BINOMIAL_AUTHOR,,
19
TRINOMIAL_AUTHOR,*REF_PLANT_DICTIONARY.TRINOMIAL_AUTHOR,,
20
QUADRINOMIAL_AUTHOR,*REF_PLANT_DICTIONARY.QUADRINOMIAL_AUTHOR,,
21
XGENUS,*REF_PLANT_DICTIONARY.XGENUS,,
22
GENUS,*REF_PLANT_DICTIONARY.GENUS,,
23
XSPECIES,*REF_PLANT_DICTIONARY.XSPECIES,,
24
SPECIES,*REF_PLANT_DICTIONARY.SPECIES,,
25
SSP,*REF_PLANT_DICTIONARY.SSP,,
26
XSUBSPECIES,*REF_PLANT_DICTIONARY.XSUBSPECIES,,
27
SUBSPECIES,*REF_PLANT_DICTIONARY.SUBSPECIES,,
28
VAR,*REF_PLANT_DICTIONARY.VAR,,
29
XVARIETY,*REF_PLANT_DICTIONARY.XVARIETY,,
30
VARIETY,*REF_PLANT_DICTIONARY.VARIETY,,
31
SUBVAR,*REF_PLANT_DICTIONARY.SUBVAR,,
32
SUBVARIETY,*REF_PLANT_DICTIONARY.SUBVARIETY,,
33
F,*REF_PLANT_DICTIONARY.F,,
34
FORMA,*REF_PLANT_DICTIONARY.FORMA,,
17
SCIENTIFIC_NAME_W_AUTHOR,scientificName,,
18
GENERA_BINOMIAL_AUTHOR,GENERA_BINOMIAL_AUTHOR,,
19
TRINOMIAL_AUTHOR,TRINOMIAL_AUTHOR,,
20
QUADRINOMIAL_AUTHOR,QUADRINOMIAL_AUTHOR,,
21
XGENUS,XGENUS,,
22
GENUS,genus,,
23
XSPECIES,XSPECIES,,
24
SPECIES,specificEpithet,,
25
SSP,SSP_PREFIX,,
26
XSUBSPECIES,XSUBSPECIES,,
27
SUBSPECIES,subspecies,,
28
VAR,VAR_PREFIX,,
29
XVARIETY,XVARIETY,,
30
VARIETY,variety,,
31
SUBVAR,SUBVAR,,
32
SUBVARIETY,SUBVARIETY,,
33
F,F_PREFIX,,
34
FORMA,forma,,
35 35
NOTES,*REF_PLANT_DICTIONARY.NOTES,,
36 36
CREATED_BY,*REF_PLANT_DICTIONARY.CREATED_BY,,
37 37
CREATED_DATE,*REF_PLANT_DICTIONARY.CREATED_DATE,,
inputs/FIA/REF_PLANT_DICTIONARY/new_terms.csv
2 2
CN,*REF_PLANT_DICTIONARY.CN,,
3 3
NEW_SYMBOL,*REF_PLANT_DICTIONARY.NEW_SYMBOL,,
4 4
NEW_SCIENTIFIC_NAME,*REF_PLANT_DICTIONARY.NEW_SCIENTIFIC_NAME,,
5
COMMON_NAME,*REF_PLANT_DICTIONARY.COMMON_NAME,,
6 5
CATEGORY,*REF_PLANT_DICTIONARY.CATEGORY,,
7
GROWTH_HABIT,*REF_PLANT_DICTIONARY.GROWTH_HABIT,,
6
GROWTH_HABIT,taxonGrowthForm,,
8 7
DURATION,*REF_PLANT_DICTIONARY.DURATION,,
9 8
US_NATIVITY,*REF_PLANT_DICTIONARY.US_NATIVITY,,
10 9
STATE_DISTRIBUTION,*REF_PLANT_DICTIONARY.STATE_DISTRIBUTION,,
11 10
STATE_AND_PROVINCE,*REF_PLANT_DICTIONARY.STATE_AND_PROVINCE,,
12
SCIENTIFIC_NAME_W_AUTHOR,*REF_PLANT_DICTIONARY.SCIENTIFIC_NAME_W_AUTHOR,,
13
GENERA_BINOMIAL_AUTHOR,*REF_PLANT_DICTIONARY.GENERA_BINOMIAL_AUTHOR,,
14
TRINOMIAL_AUTHOR,*REF_PLANT_DICTIONARY.TRINOMIAL_AUTHOR,,
15
QUADRINOMIAL_AUTHOR,*REF_PLANT_DICTIONARY.QUADRINOMIAL_AUTHOR,,
16
XGENUS,*REF_PLANT_DICTIONARY.XGENUS,,
17
XSPECIES,*REF_PLANT_DICTIONARY.XSPECIES,,
18
XSUBSPECIES,*REF_PLANT_DICTIONARY.XSUBSPECIES,,
19
XVARIETY,*REF_PLANT_DICTIONARY.XVARIETY,,
20
SUBVAR,*REF_PLANT_DICTIONARY.SUBVAR,,
21
SUBVARIETY,*REF_PLANT_DICTIONARY.SUBVARIETY,,
22
F,*REF_PLANT_DICTIONARY.F,,
11
SCIENTIFIC_NAME_W_AUTHOR,scientificName,,
12
F,F_PREFIX,,
23 13
CREATED_BY,*REF_PLANT_DICTIONARY.CREATED_BY,,
24 14
CREATED_DATE,*REF_PLANT_DICTIONARY.CREATED_DATE,,
25 15
CREATED_IN_INSTANCE,*REF_PLANT_DICTIONARY.CREATED_IN_INSTANCE,,
inputs/FIA/REF_PLANT_DICTIONARY/unmapped_terms.csv
2 2
*REF_PLANT_DICTIONARY.CN
3 3
SYMBOL_TYPE
4 4
SYMBOL
5
*REF_PLANT_DICTIONARY.SCIENTIFIC_NAME
6 5
*REF_PLANT_DICTIONARY.NEW_SYMBOL
7 6
*REF_PLANT_DICTIONARY.NEW_SCIENTIFIC_NAME
8
*REF_PLANT_DICTIONARY.COMMON_NAME
7
COMMON_NAME
9 8
*REF_PLANT_DICTIONARY.CATEGORY
10
*REF_PLANT_DICTIONARY.FAMILY
11
*REF_PLANT_DICTIONARY.GROWTH_HABIT
9
taxonGrowthForm
12 10
*REF_PLANT_DICTIONARY.DURATION
13 11
*REF_PLANT_DICTIONARY.US_NATIVITY
14 12
*REF_PLANT_DICTIONARY.STATE_DISTRIBUTION
15 13
*REF_PLANT_DICTIONARY.STATE_AND_PROVINCE
16
*REF_PLANT_DICTIONARY.SCIENTIFIC_NAME_W_AUTHOR
17
*REF_PLANT_DICTIONARY.GENERA_BINOMIAL_AUTHOR
18
*REF_PLANT_DICTIONARY.TRINOMIAL_AUTHOR
19
*REF_PLANT_DICTIONARY.QUADRINOMIAL_AUTHOR
20
*REF_PLANT_DICTIONARY.XGENUS
21
*REF_PLANT_DICTIONARY.GENUS
22
*REF_PLANT_DICTIONARY.XSPECIES
23
*REF_PLANT_DICTIONARY.SPECIES
24
*REF_PLANT_DICTIONARY.SSP
25
*REF_PLANT_DICTIONARY.XSUBSPECIES
26
*REF_PLANT_DICTIONARY.SUBSPECIES
27
*REF_PLANT_DICTIONARY.VAR
28
*REF_PLANT_DICTIONARY.XVARIETY
29
*REF_PLANT_DICTIONARY.VARIETY
30
*REF_PLANT_DICTIONARY.SUBVAR
31
*REF_PLANT_DICTIONARY.SUBVARIETY
32
*REF_PLANT_DICTIONARY.F
33
*REF_PLANT_DICTIONARY.FORMA
14
GENERA_BINOMIAL_AUTHOR
15
TRINOMIAL_AUTHOR
16
QUADRINOMIAL_AUTHOR
17
XGENUS
18
XSPECIES
19
SSP_PREFIX
20
XSUBSPECIES
21
VAR_PREFIX
22
XVARIETY
23
SUBVAR
24
SUBVARIETY
25
F_PREFIX
34 26
*REF_PLANT_DICTIONARY.NOTES
35 27
*REF_PLANT_DICTIONARY.CREATED_BY
36 28
*REF_PLANT_DICTIONARY.CREATED_DATE
inputs/FIA/REF_UNIT/import
6 6
map_table
7 7
psql <<'EOF'
8 8
SELECT functions.set_col_types('"REF_UNIT"', ARRAY[
9
  ('STATECD' , 'integer')
10
, ('UNITCD' , 'integer')
9
  ('STATECD', 'integer')
10
, ('UNITCD', 'integer')
11 11
]::functions.col_cast[]);
12 12

  
13 13
SELECT functions.create_if_not_exists($$ALTER TABLE "REF_UNIT" ADD CONSTRAINT "REF_UNIT.unique" UNIQUE ("STATECD", "UNITCD")$$);
inputs/FIA/COND/map.csv
6 6
STATECD,STATECD,,
7 7
UNITCD,UNITCD,,
8 8
COUNTYCD,COUNTYCD,,
9
PLOT,PLOT,,
10
CONDID,CONDID,,
9
PLOT,locationName,,
10
CONDID,authorEventCode,,
11 11
COND_STATUS_CD,*COND.COND_STATUS_CD,,
12 12
COND_NONSAMPLE_REASN_CD,*COND.COND_NONSAMPLE_REASN_CD,,
13 13
RESERVCD,*COND.RESERVCD,,
......
32 32
MICRPROP_UNADJ,*COND.MICRPROP_UNADJ,,
33 33
SUBPPROP_UNADJ,*COND.SUBPPROP_UNADJ,,
34 34
MACRPROP_UNADJ,*COND.MACRPROP_UNADJ,,
35
SLOPE,*COND.SLOPE,,
36
ASPECT,*COND.ASPECT,,
35
SLOPE,SLOPE,,
36
ASPECT,ASPECT,,
37 37
PHYSCLCD,*COND.PHYSCLCD,,
38 38
GSSTKCD,*COND.GSSTKCD,,
39 39
ALSTKCD,*COND.ALSTKCD,,
inputs/FIA/COND/import
6 6
map_table
7 7
psql <<'EOF'
8 8
SELECT functions.set_col_types('"COND"', ARRAY[
9
  ('STATECD' , 'integer')
10
, ('UNITCD'  , 'integer')
9
  ('STATECD', 'integer')
10
, ('UNITCD', 'integer')
11 11
, ('COUNTYCD', 'integer')
12
, ('PLOT'    , 'integer')
13
, ('INVYR'   , 'integer')
14
, ('CONDID'  , 'integer')
12
, ('locationName', 'integer')
13
, ('INVYR', 'integer')
14
, ('authorEventCode', 'integer')
15 15
]::functions.col_cast[]);
16 16

  
17 17
SELECT functions.create_if_not_exists($$
......
30 30
;
31 31
$$);
32 32

  
33
SELECT functions.create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.ID"     UNIQUE ("*COND.CN")                                                $$);
34
SELECT functions.create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "PLOT", "INVYR", "CONDID")$$);
33
SELECT functions.create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.ID"     UNIQUE ("*COND.CN")$$);
34
SELECT functions.create_if_not_exists($$ALTER TABLE "COND" ADD CONSTRAINT "COND.unique" UNIQUE ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR", "authorEventCode")$$);
35 35
SELECT functions.cluster_once('"COND"', '"COND.unique"');
inputs/FIA/COND/new_terms.csv
1 1
row_num,*COND.row_num,,
2 2
CN,*COND.CN,,
3 3
PLT_CN,*COND.PLT_CN,,
4
PLOT,locationName,,
5
CONDID,authorEventCode,,
4 6
COND_STATUS_CD,*COND.COND_STATUS_CD,,
5 7
COND_NONSAMPLE_REASN_CD,*COND.COND_NONSAMPLE_REASN_CD,,
6 8
RESERVCD,*COND.RESERVCD,,
......
25 27
MICRPROP_UNADJ,*COND.MICRPROP_UNADJ,,
26 28
SUBPPROP_UNADJ,*COND.SUBPPROP_UNADJ,,
27 29
MACRPROP_UNADJ,*COND.MACRPROP_UNADJ,,
28
SLOPE,*COND.SLOPE,,
29
ASPECT,*COND.ASPECT,,
30 30
PHYSCLCD,*COND.PHYSCLCD,,
31 31
GSSTKCD,*COND.GSSTKCD,,
32 32
ALSTKCD,*COND.ALSTKCD,,
inputs/FIA/COND/unmapped_terms.csv
5 5
STATECD
6 6
UNITCD
7 7
COUNTYCD
8
PLOT
9
CONDID
10 8
*COND.COND_STATUS_CD
11 9
*COND.COND_NONSAMPLE_REASN_CD
12 10
*COND.RESERVCD
......
31 29
*COND.MICRPROP_UNADJ
32 30
*COND.SUBPPROP_UNADJ
33 31
*COND.MACRPROP_UNADJ
34
*COND.SLOPE
35
*COND.ASPECT
32
SLOPE
33
ASPECT
36 34
*COND.PHYSCLCD
37 35
*COND.GSSTKCD
38 36
*COND.ALSTKCD
inputs/FIA/TREE/map.csv
1 1
FIA,VegCore,Filter,Comments
2 2
row_num,*TREE.row_num,,
3
CN,*TREE.CN,,
3
CN,individualObservationID,,
4 4
PLT_CN,*TREE.PLT_CN,,
5 5
PREV_TRE_CN,*TREE.PREV_TRE_CN,,
6 6
INVYR,INVYR,,
7 7
STATECD,STATECD,,
8 8
UNITCD,UNITCD,,
9 9
COUNTYCD,COUNTYCD,,
10
PLOT,PLOT,,
11
SUBP,SUBP,,
12
TREE,*TREE.TREE,,
13
CONDID,CONDID,,
10
PLOT,locationName,,
11
SUBP,subplot,,
12
TREE,individualCode,,
13
CONDID,authorEventCode,,
14 14
AZIMUTH,*TREE.AZIMUTH,,
15 15
DIST,*TREE.DIST,,
16 16
PREVCOND,*TREE.PREVCOND,,
17 17
STATUSCD,*TREE.STATUSCD,,
18 18
SPCD,SPCD,,
19 19
SPGRPCD,*TREE.SPGRPCD,,
20
DIA,*TREE.DIA,,
21
DIAHTCD,*TREE.DIAHTCD,,
22
HT,*TREE.HT,,
20
DIA,diameterBreastHeight_in,,"""dbh in inches (convert to cm) IF DIAHTCD=1. Otherwise, measured at ground level (see DIAHTCD)."" (bboyle@email.arizona.edu/Brad_Boyle.2013-2-8.[FIA+tables+and+columns+to+import+to+BIEN.docx])"
21
DIAHTCD,*TREE.DIAHTCD,,"""DIAHTCD=1: DIA measured at breast height (=dbh); DIAHTCD=1: DIA measured at root crown (basically, near ground). We should discuss where to put these measurements."" (bboyle@email.arizona.edu/Brad_Boyle.2013-2-8.[FIA+tables+and+columns+to+import+to+BIEN.docx])"
22
HT,height_ft,,"""height in ft. Convert to m."" (bboyle@email.arizona.edu/Brad_Boyle.2013-2-8.[FIA+tables+and+columns+to+import+to+BIEN.docx])"
23 23
HTCD,*TREE.HTCD,,
24 24
ACTUALHT,*TREE.ACTUALHT,,
25 25
TREECLCD,*TREE.TREECLCD,,
......
75 75
BFSND,*TREE.BFSND,,
76 76
CFSND,*TREE.CFSND,,
77 77
SAWHT,*TREE.SAWHT,,
78
BOLEHT,*TREE.BOLEHT,,
78
BOLEHT,BOLEHT,,
79 79
FORMCL,*TREE.FORMCL,,
80 80
HTCALC,*TREE.HTCALC,,
81 81
HRDWD_CLUMP_CD,*TREE.HRDWD_CLUMP_CD,,
inputs/FIA/TREE/import
6 6
map_table
7 7
psql <<'EOF'
8 8
SELECT functions.set_col_types('"TREE"', ARRAY[
9
  ('STATECD' , 'integer')
10
, ('UNITCD'  , 'integer')
9
  ('STATECD', 'integer')
10
, ('UNITCD', 'integer')
11 11
, ('COUNTYCD', 'integer')
12
, ('PLOT'    , 'integer')
13
, ('INVYR'   , 'integer')
14
, ('SUBP'    , 'integer')
15
, ('CONDID'  , 'integer')
16
, ('SPCD'    , 'integer')
12
, ('locationName', 'integer')
13
, ('INVYR', 'integer')
14
, ('subplot', 'integer')
15
, ('authorEventCode', 'integer')
16
, ('SPCD', 'integer')
17 17
]::functions.col_cast[]);
18 18

  
19
-- ("STATECD", "UNITCD", "COUNTYCD", "PLOT", "INVYR", "CONDID", "SUBP", "TREE", "STATUSCD") is not ID
20
SELECT functions.create_if_not_exists($$ALTER TABLE "TREE" ADD CONSTRAINT "TREE.ID" UNIQUE ("*TREE.CN")$$);
19
-- ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR", "authorEventCode", "subplot", "TREE", "STATUSCD") is not ID
20
SELECT functions.create_if_not_exists($$ALTER TABLE "TREE" ADD CONSTRAINT "TREE.ID" UNIQUE ("individualObservationID")$$);
21 21
SELECT functions.cluster_once('"TREE"', '"TREE.ID"');
22 22

  
23
SELECT functions.create_if_not_exists($$CREATE INDEX "TREE.parent" ON "TREE" ("STATECD", "UNITCD", "COUNTYCD", "PLOT", "INVYR", "CONDID", "SUBP")$$);
23
SELECT functions.create_if_not_exists($$CREATE INDEX "TREE.parent" ON "TREE" ("STATECD", "UNITCD", "COUNTYCD", "locationName", "INVYR", "authorEventCode", "subplot")$$);
inputs/FIA/TREE/new_terms.csv
1 1
row_num,*TREE.row_num,,
2
CN,*TREE.CN,,
2
CN,individualObservationID,,
3 3
PLT_CN,*TREE.PLT_CN,,
4 4
PREV_TRE_CN,*TREE.PREV_TRE_CN,,
5
TREE,*TREE.TREE,,
5
PLOT,locationName,,
6
SUBP,subplot,,
7
TREE,individualCode,,
8
CONDID,authorEventCode,,
6 9
AZIMUTH,*TREE.AZIMUTH,,
7 10
DIST,*TREE.DIST,,
8 11
PREVCOND,*TREE.PREVCOND,,
9 12
STATUSCD,*TREE.STATUSCD,,
10 13
SPGRPCD,*TREE.SPGRPCD,,
11
DIA,*TREE.DIA,,
12
DIAHTCD,*TREE.DIAHTCD,,
13
HT,*TREE.HT,,
14
DIA,diameterBreastHeight_in,,"""dbh in inches (convert to cm) IF DIAHTCD=1. Otherwise, measured at ground level (see DIAHTCD)."" (bboyle@email.arizona.edu/Brad_Boyle.2013-2-8.[FIA+tables+and+columns+to+import+to+BIEN.docx])"
15
DIAHTCD,*TREE.DIAHTCD,,"""DIAHTCD=1: DIA measured at breast height (=dbh); DIAHTCD=1: DIA measured at root crown (basically, near ground). We should discuss where to put these measurements."" (bboyle@email.arizona.edu/Brad_Boyle.2013-2-8.[FIA+tables+and+columns+to+import+to+BIEN.docx])"
16
HT,height_ft,,"""height in ft. Convert to m."" (bboyle@email.arizona.edu/Brad_Boyle.2013-2-8.[FIA+tables+and+columns+to+import+to+BIEN.docx])"
14 17
HTCD,*TREE.HTCD,,
15 18
ACTUALHT,*TREE.ACTUALHT,,
16 19
TREECLCD,*TREE.TREECLCD,,
......
66 69
BFSND,*TREE.BFSND,,
67 70
CFSND,*TREE.CFSND,,
68 71
SAWHT,*TREE.SAWHT,,
69
BOLEHT,*TREE.BOLEHT,,
70 72
FORMCL,*TREE.FORMCL,,
71 73
HTCALC,*TREE.HTCALC,,
72 74
HRDWD_CLUMP_CD,*TREE.HRDWD_CLUMP_CD,,
inputs/FIA/TREE/unmapped_terms.csv
1 1
*TREE.row_num
2
*TREE.CN
3 2
*TREE.PLT_CN
4 3
*TREE.PREV_TRE_CN
5 4
INVYR
6 5
STATECD
7 6
UNITCD
8 7
COUNTYCD
9
PLOT
10
SUBP
11
*TREE.TREE
12
CONDID
13 8
*TREE.AZIMUTH
14 9
*TREE.DIST
15 10
*TREE.PREVCOND
16 11
*TREE.STATUSCD
17 12
SPCD
18 13
*TREE.SPGRPCD
19
*TREE.DIA
20 14
*TREE.DIAHTCD
21
*TREE.HT
22 15
*TREE.HTCD
23 16
*TREE.ACTUALHT
24 17
*TREE.TREECLCD
......
74 67
*TREE.BFSND
75 68
*TREE.CFSND
76 69
*TREE.SAWHT
77
*TREE.BOLEHT
70
BOLEHT
78 71
*TREE.FORMCL
79 72
*TREE.HTCALC
80 73
*TREE.HRDWD_CLUMP_CD
inputs/FIA/occurrence_all/import
20 20
	NATURAL LEFT JOIN "REF_SPECIES"
21 21
	NATURAL LEFT JOIN "REF_PLANT_DICTIONARY"
22 22
)))))))
23
ORDER BY "*TREE.CN"
23
ORDER BY "individualObservationID"
inputs/FIA/REF_HABTYP_DESCRIPTION/map.csv
1 1
FIA,VegCore,Filter,Comments
2 2
row_num,*REF_HABTYP_DESCRIPTION.row_num,,
3
CN,*REF_HABTYP_DESCRIPTION.CN,,
3
CN,communityID,,
4 4
HABTYPCD,HABTYPCD,,
5 5
PUB_CD,HABTYP_PUB_CD,,
6 6
SCIENTIFIC_NAME,*REF_HABTYP_DESCRIPTION.SCIENTIFIC_NAME,,
7
COMMON_NAME,*REF_HABTYP_DESCRIPTION.COMMON_NAME,,
7
COMMON_NAME,communityName,,
8 8
VALID,*REF_HABTYP_DESCRIPTION.VALID,,
9 9
CREATED_BY,*REF_HABTYP_DESCRIPTION.CREATED_BY,,
10 10
CREATED_DATE,*REF_HABTYP_DESCRIPTION.CREATED_DATE,,
inputs/FIA/REF_HABTYP_DESCRIPTION/new_terms.csv
1 1
row_num,*REF_HABTYP_DESCRIPTION.row_num,,
2
CN,*REF_HABTYP_DESCRIPTION.CN,,
2
CN,communityID,,
3 3
PUB_CD,HABTYP_PUB_CD,,
4
COMMON_NAME,*REF_HABTYP_DESCRIPTION.COMMON_NAME,,
4
COMMON_NAME,communityName,,
5 5
VALID,*REF_HABTYP_DESCRIPTION.VALID,,
6 6
CREATED_BY,*REF_HABTYP_DESCRIPTION.CREATED_BY,,
7 7
CREATED_DATE,*REF_HABTYP_DESCRIPTION.CREATED_DATE,,
inputs/FIA/REF_HABTYP_DESCRIPTION/unmapped_terms.csv
1 1
*REF_HABTYP_DESCRIPTION.row_num
2
*REF_HABTYP_DESCRIPTION.CN
3 2
HABTYPCD
4 3
HABTYP_PUB_CD
5 4
*REF_HABTYP_DESCRIPTION.SCIENTIFIC_NAME
6
*REF_HABTYP_DESCRIPTION.COMMON_NAME
7 5
*REF_HABTYP_DESCRIPTION.VALID
8 6
*REF_HABTYP_DESCRIPTION.CREATED_BY
9 7
*REF_HABTYP_DESCRIPTION.CREATED_DATE
inputs/FIA/SUBPLOT/map.csv
1 1
FIA,VegCore,Filter,Comments
2 2
row_num,*SUBPLOT.row_num,,
3
CN,*SUBPLOT.CN,,
3
CN,subplotID,,
4 4
PLT_CN,*SUBPLOT.PLT_CN,,
5 5
PREV_SBP_CN,*SUBPLOT.PREV_SBP_CN,,
6 6
INVYR,INVYR,,
7 7
STATECD,STATECD,,
8 8
UNITCD,UNITCD,,
9 9
COUNTYCD,COUNTYCD,,
10
PLOT,PLOT,,
11
SUBP,SUBP,,
10
PLOT,locationName,,
11
SUBP,subplot,,
12 12
SUBP_STATUS_CD,*SUBPLOT.SUBP_STATUS_CD,,
13 13
POINT_NONSAMPLE_REASN_CD,*SUBPLOT.POINT_NONSAMPLE_REASN_CD,,
14 14
MICRCOND,*SUBPLOT.MICRCOND,,
inputs/FIA/SUBPLOT/new_terms.csv
1 1
row_num,*SUBPLOT.row_num,,
2
CN,*SUBPLOT.CN,,
2
CN,subplotID,,
3 3
PLT_CN,*SUBPLOT.PLT_CN,,
4 4
PREV_SBP_CN,*SUBPLOT.PREV_SBP_CN,,
5
PLOT,locationName,,
6
SUBP,subplot,,
5 7
SUBP_STATUS_CD,*SUBPLOT.SUBP_STATUS_CD,,
6 8
POINT_NONSAMPLE_REASN_CD,*SUBPLOT.POINT_NONSAMPLE_REASN_CD,,
7 9
MICRCOND,*SUBPLOT.MICRCOND,,
inputs/FIA/REF_RESEARCH_STATION/map.csv
3 3
STATECD,STATECD,,
4 4
RSCD,*REF_RESEARCH_STATION.RSCD,,
5 5
RS,*REF_RESEARCH_STATION.RS,,
6
STATE_NAME,*REF_RESEARCH_STATION.STATE_NAME,,
6
STATE_NAME,stateProvince,,
7 7
STATE_ABBR,*REF_RESEARCH_STATION.STATE_ABBR,,
8 8
CREATED_BY,*REF_RESEARCH_STATION.CREATED_BY,,
9 9
CREATED_DATE,*REF_RESEARCH_STATION.CREATED_DATE,,
inputs/FIA/REF_RESEARCH_STATION/new_terms.csv
1 1
row_num,*REF_RESEARCH_STATION.row_num,,
2 2
RSCD,*REF_RESEARCH_STATION.RSCD,,
3 3
RS,*REF_RESEARCH_STATION.RS,,
4
STATE_NAME,*REF_RESEARCH_STATION.STATE_NAME,,
4
STATE_NAME,stateProvince,,
5 5
STATE_ABBR,*REF_RESEARCH_STATION.STATE_ABBR,,
6 6
CREATED_BY,*REF_RESEARCH_STATION.CREATED_BY,,
7 7
CREATED_DATE,*REF_RESEARCH_STATION.CREATED_DATE,,

Also available in: Unified diff