Project

General

Profile

« Previous | Next » 

Revision 8255

inputs/FIA/: Archived no longer used subdirs from BIEN2 export

View differences:

inputs/FIA/Organism/test.xml.ref
1
Put template:
2
<VegBIEN>
3
    <_setDefault id="-1">
4
        <source_id><source><shortname>FIA</shortname></source></source_id>
5
        <path>
6
            <_simplifyPath>
7
                <next>parent_id</next>
8
                <path>
9
                    <location>
10
                        <sourceaccessioncode>$PlotCD</sourceaccessioncode>
11
                        <locationevent>
12
                            <taxonoccurrence>
13
                                <aggregateoccurrence>
14
                                    <collectiondate>
15
                                        <_date>
16
                                            <day>
17
                                                <_nullIf>
18
                                                    <null>0</null>
19
                                                    <type>float</type>
20
                                                    <value>$MeasDay</value>
21
                                                </_nullIf>
22
                                            </day>
23
                                            <month>
24
                                                <_nullIf>
25
                                                    <null>0</null>
26
                                                    <type>float</type>
27
                                                    <value>$MeasMon</value>
28
                                                </_nullIf>
29
                                            </month>
30
                                            <year>
31
                                                <_nullIf>
32
                                                    <null>0</null>
33
                                                    <type>float</type>
34
                                                    <value>$MeasYear</value>
35
                                                </_nullIf>
36
                                            </year>
37
                                        </_date>
38
                                    </collectiondate>
39
                                    <plantobservation>
40
                                        <stemobservation>
41
                                            <basaldiameter_m><_in_to_m><value>$BasalDiameter</value></_in_to_m></basaldiameter_m>
42
                                            <diameterbreastheight_m><_in_to_m><value>$DBH</value></_in_to_m></diameterbreastheight_m>
43
                                            <height_m><_ft_to_m><value>$Height</value></_ft_to_m></height_m>
44
                                            <tag>$TreeTag</tag>
45
                                        </stemobservation>
46
                                    </plantobservation>
47
                                </aggregateoccurrence>
48
                                <authortaxoncode>$TreeTag</authortaxoncode>
49
                                <taxondetermination>
50
                                    <taxonverbatim_id>
51
                                        <taxonverbatim>
52
                                            <taxonlabel_id>
53
                                                <taxonlabel>
54
                                                    <parent_id>
55
                                                        <taxonlabel>
56
                                                            <parent_id>
57
                                                                <taxonlabel>
58
                                                                    <rank>cultivar</rank>
59
                                                                    <parent_id>
60
                                                                        <taxonlabel>
61
                                                                            <rank>forma</rank>
62
                                                                            <parent_id>
63
                                                                                <taxonlabel>
64
                                                                                    <rank>variety</rank>
65
                                                                                    <parent_id>
66
                                                                                        <taxonlabel>
67
                                                                                            <rank>subspecies</rank>
68
                                                                                            <parent_id>
69
                                                                                                <taxonlabel>
70
                                                                                                    <rank>species</rank>
71
                                                                                                    <taxonepithet>$SpecificEpithet</taxonepithet>
72
                                                                                                    <parent_id>
73
                                                                                                        <taxonlabel>
74
                                                                                                            <rank>genus</rank>
75
                                                                                                            <taxonepithet>$Genus</taxonepithet>
76
                                                                                                        </taxonlabel>
77
                                                                                                    </parent_id>
78
                                                                                                </taxonlabel>
79
                                                                                            </parent_id>
80
                                                                                        </taxonlabel>
81
                                                                                    </parent_id>
82
                                                                                </taxonlabel>
83
                                                                            </parent_id>
84
                                                                        </taxonlabel>
85
                                                                    </parent_id>
86
                                                                </taxonlabel>
87
                                                            </parent_id>
88
                                                        </taxonlabel>
89
                                                    </parent_id>
90
                                                    <taxonomicname>
91
                                                        <_join_words>
92
                                                            <2>$Genus</2>
93
                                                            <3>$SpecificEpithet</3>
94
                                                        </_join_words>
95
                                                    </taxonomicname>
96
                                                </taxonlabel>
97
                                            </taxonlabel_id>
98
                                            <genus>$Genus</genus>
99
                                            <specific_epithet>$SpecificEpithet</specific_epithet>
100
                                        </taxonverbatim>
101
                                    </taxonverbatim_id>
102
                                </taxondetermination>
103
                            </taxonoccurrence>
104
                        </locationevent>
105
                        <locationplace>
106
                            <place_id>
107
                                <place>
108
                                    <coordinates_id>
109
                                        <coordinates>
110
                                            <latitude_deg>
111
                                                <_nullIf>
112
                                                    <null>0</null>
113
                                                    <type>float</type>
114
                                                    <value>$DecimalLatitude</value>
115
                                                </_nullIf>
116
                                            </latitude_deg>
117
                                            <longitude_deg>
118
                                                <_nullIf>
119
                                                    <null>0</null>
120
                                                    <type>float</type>
121
                                                    <value>$DecimalLongitude</value>
122
                                                </_nullIf>
123
                                            </longitude_deg>
124
                                        </coordinates>
125
                                    </coordinates_id>
126
                                    <county>$County</county>
127
                                    <matched_place_id>
128
                                        <place>
129
                                            <source_id><source><shortname>geoscrub</shortname></source></source_id>
130
                                            <coordinates_id>
131
                                                <coordinates>
132
                                                    <source_id><source><shortname>geoscrub</shortname></source></source_id>
133
                                                    <latitude_deg>
134
                                                        <_nullIf>
135
                                                            <null>0</null>
136
                                                            <type>float</type>
137
                                                            <value>$DecimalLatitude</value>
138
                                                        </_nullIf>
139
                                                    </latitude_deg>
140
                                                    <longitude_deg>
141
                                                        <_nullIf>
142
                                                            <null>0</null>
143
                                                            <type>float</type>
144
                                                            <value>$DecimalLongitude</value>
145
                                                        </_nullIf>
146
                                                    </longitude_deg>
147
                                                </coordinates>
148
                                            </coordinates_id>
149
                                            <county>$County</county>
150
                                            <stateprovince>$StateProvince</stateprovince>
151
                                        </place>
152
                                    </matched_place_id>
153
                                    <stateprovince>$StateProvince</stateprovince>
154
                                </place>
155
                            </place_id>
156
                        </locationplace>
157
                    </location>
158
                </path>
159
            </_simplifyPath>
160
        </path>
161
    </_setDefault>
162
</VegBIEN>
163
Inserted 23 new rows into database
inputs/FIA/Organism/VegBIEN.csv
1
FIA,VegBIEN:/_setDefault:[source_id/source/shortname/_env:[name=source]]/path/_simplifyPath:[next=parent_id]/path,Comments
2
PlotCD,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/2/_if[@name=""if locationID""]/cond/_exists",
3
PlotCD,"/location/_if[@name=""if subplot""]/else/sourceaccessioncode",
4
PlotCD,"/location/_if[@name=""if subplot""]/then/parent_id/location/sourceaccessioncode",
5
PlotCD,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
6
MeasDay,"/location/locationevent/taxonoccurrence/aggregateoccurrence/collectiondate/_alt/2/_date/day/_nullIf:[null=0,type=float]/value",
7
MeasMon,"/location/locationevent/taxonoccurrence/aggregateoccurrence/collectiondate/_alt/2/_date/month/_nullIf:[null=0,type=float]/value",
8
MeasYear,"/location/locationevent/taxonoccurrence/aggregateoccurrence/collectiondate/_alt/2/_date/year/_nullIf:[null=0,type=float]/value",
9
BasalDiameter,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/basaldiameter_m/_in_to_m/value,Assuming units are the same as for DBH because the values are similar and they measure the same dimension
10
DBH,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/diameterbreastheight_m/_in_to_m/value,Assuming units based on the range and precision of values and location inside the U.S.
11
Height,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/height_m/_ft_to_m/value,"Assuming units based on the range of values, the height of the tallest tree [1], and location inside the U.S.
12

  
13
[1] ""The tallest living tree is believed to be a coast redwood [which] is 115.66 metres (379.5 ft) tall"" (http://en.wikipedia.org/wiki/Tree#Superlative_trees)"
14
TreeTag,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/tag,
15
PlotCD,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
16
TreeTag,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/2/_first/2",
17
SpecificEpithet,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=species]/taxonepithet",
18
Genus,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,species,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=genus]/taxonepithet",
19
Genus,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/1/_alt/2/_join_words/2,
20
SpecificEpithet,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/1/_alt/2/_join_words/3/_join_words/1,
21
Genus,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/genus,
22
SpecificEpithet,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/specific_epithet,
23
DecimalLatitude,"/location/locationplace/*_id/place/*_id/coordinates/latitude_deg/_nullIf:[null=0,type=float]/value",
24
DecimalLongitude,"/location/locationplace/*_id/place/*_id/coordinates/longitude_deg/_nullIf:[null=0,type=float]/value",
25
County,/location/locationplace/*_id/place/county,
26
DecimalLatitude,"/location/locationplace/*_id/place/matched_place_id/place:[.,source_id/source/shortname=geoscrub]/*_id/coordinates:[source_id/source/shortname=geoscrub]/_first/2/latitude_deg/_nullIf:[null=0,type=float]/value",""".,"" sorts it with other coordinates mappings"
27
DecimalLongitude,"/location/locationplace/*_id/place/matched_place_id/place:[.,source_id/source/shortname=geoscrub]/*_id/coordinates:[source_id/source/shortname=geoscrub]/_first/2/longitude_deg/_nullIf:[null=0,type=float]/value",""".,"" sorts it with other coordinates mappings"
28
County,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/county/_first/2,
29
StateProvince,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/stateprovince/_first/2,
30
StateProvince,/location/locationplace/*_id/place/stateprovince,
31
PlotCD,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/cond/_exists",
32
PlotCD,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/then/_if[@name=""if subplot""]/then/_join/1",
33
HOM,,** No join mapping for *HOM ** 
inputs/FIA/Organism/import
1
#!/bin/bash
2
# :mode=transact-sql:
3
cd "$(dirname "$0")"
4
. ../../../lib/import.sh
5

  
6
psql <<'EOF'
7
ALTER TABLE :table ALTER COLUMN "PlotCD" TYPE bigint
8
USING "PlotCD"::bigint;
9 0

  
inputs/FIA/Organism/new_terms.csv
1
TreeTag,tag,,
2
MeasYear,yearCollected,,
3
MeasMon,monthCollected,,
4
MeasDay,dayCollected,,
5
PlotCD,locationID,,
inputs/FIA/Organism/unmapped_terms.csv
1
*HOM
inputs/FIA/Organism/map.csv
1
FIA,VegCore,Filter,Comments
2
TreeTag,tag,,
3
Genus,genus,,
4
SpecificEpithet,specificEpithet,,
5
MeasYear,yearCollected,,
6
MeasMon,monthCollected,,
7
MeasDay,dayCollected,,
8
DecimalLatitude,decimalLatitude,,
9
DecimalLongitude,decimalLongitude,,
10
PlotCD,locationID,,
11
StateProvince,stateProvince,,
12
County,county,,
13
DBH,diameterBreastHeight_in,,Assuming units based on the range and precision of values and location inside the U.S.
14
HOM,*HOM,,
15
BasalDiameter,basalDiameter_in,,Assuming units are the same as for DBH because the values are similar and they measure the same dimension
16
Height,height_ft,,"Assuming units based on the range of values, the height of the tallest tree [1], and location inside the U.S.
17

  
18
[1] ""The tallest living tree is believed to be a coast redwood [which] is 115.66 metres (379.5 ft) tall"" (http://en.wikipedia.org/wiki/Tree#Superlative_trees)"
inputs/FIA/FIA_COND_unique/create.sql
1
SELECT
2
DISTINCT ON ("PLT_CN")
3
*
4
FROM "FIA_COND"
5
;
6

  
7
ALTER TABLE :table ADD PRIMARY KEY ("PLT_CN");
8

  
9
--ALTER TABLE :table ADD COLUMN oldgrowth boolean;
10
ALTER TABLE :table ALTER COLUMN oldgrowth TYPE boolean
11
USING
12
(
13
"STDAGE">80 
14
AND ("TRTCD1"='0' OR "TRTCD1" IS NULL)
15
AND (("DSTRBCD1"<>'30' AND "DSTRBCD1"<>'31' AND "DSTRBCD1"<>'32' AND "DSTRBCD1"<>'80') OR "DSTRBCD1" IS NULL)
16
AND ("STUMP_CD_PNWRS"='N' OR "STUMP_CD_PNWRS" IS NULL)
17
AND "HARVEST_TYPE1_SRS" IS NULL
18
AND "PRESNFCD" IS NULL
19
AND ("STDORGCD"=0 OR "STDORGCD" IS NULL)
20
)
21
OR "STND_COND_CD_PNWRS"='7'
22
;
inputs/FIA/FIA_COND_unique/header.csv
1
CN,PLT_CN,INVYR,STATECD,UNITCD,COUNTYCD,PLOT,CONDID,COND_STATUS_CD,COND_NONSAMPLE_REASN_CD,RESERVCD,OWNCD,OWNGRPCD,FORINDCD,ADFORCD,FORTYPCD,FLDTYPCD,MAPDEN,STDAGE,STDSZCD,FLDSZCD,SITECLCD,SICOND,SIBASE,SISP,STDORGCD,STDORGSP,PROP_BASIS,CONDPROP_UNADJ,MICRPROP_UNADJ,SUBPPROP_UNADJ,MACRPROP_UNADJ,SLOPE,ASPECT,PHYSCLCD,GSSTKCD,ALSTKCD,DSTRBCD1,DSTRBYR1,DSTRBCD2,DSTRBYR2,DSTRBCD3,DSTRBYR3,TRTCD1,TRTYR1,TRTCD2,TRTYR2,TRTCD3,TRTYR3,PRESNFCD,BALIVE,FLDAGE,ALSTK,GSSTK,FORTYPCDCALC,HABTYPCD1,HABTYPCD1_PUB_CD,HABTYPCD1_DESCR_PUB_CD,HABTYPCD2,HABTYPCD2_PUB_CD,HABTYPCD2_DESCR_PUB_CD,MIXEDCONFCD,VOL_LOC_GRP,SITECLCDEST,SITETREE_TREE,SITECL_METHOD,CARBON_DOWN_DEAD,CARBON_LITTER,CARBON_SOIL_ORG,CARBON_STANDING_DEAD,CARBON_UNDERSTORY_AG,CARBON_UNDERSTORY_BG,CREATED_BY,CREATED_DATE,CREATED_IN_INSTANCE,MODIFIED_BY,MODIFIED_DATE,MODIFIED_IN_INSTANCE,CYCLE,SUBCYCLE,SOIL_ROOTING_DEPTH_PNW,GROUND_LAND_CLASS_PNW,PLANT_STOCKABILITY_FACTOR_PNW,STND_COND_CD_PNWRS,STND_STRUC_CD_PNWRS,STUMP_CD_PNWRS,FIRE_SRS,GRAZING_SRS,HARVEST_TYPE1_SRS,HARVEST_TYPE2_SRS,HARVEST_TYPE3_SRS,LAND_USE_SRS,OPERABILITY_SRS,STAND_STRUCTURE_SRS,oldgrowth,Index_CN_index,Index_PLT_CN_index,Index_4_index,Index_5_index,Index_6_index,Index_7_index,Index_oldgrowth_index
inputs/FIA/FIA_COND_unique/map.csv
1
FIA,VegCore,Filter,Comments
2
CN,*CN,,
3
PLT_CN,locationID,,
4
INVYR,*INVYR,,
5
STATECD,*STATECD,,
6
UNITCD,*UNITCD,,
7
COUNTYCD,*COUNTYCD,,
8
PLOT,locationName,,
9
CONDID,authorEventCode,,
10
COND_STATUS_CD,*COND_STATUS_CD,,
11
COND_NONSAMPLE_REASN_CD,*COND_NONSAMPLE_REASN_CD,,
12
RESERVCD,*RESERVCD,,
13
OWNCD,*OWNCD,,
14
OWNGRPCD,*OWNGRPCD,,
15
FORINDCD,*FORINDCD,,
16
ADFORCD,*ADFORCD,,
17
FORTYPCD,*FORTYPCD,,
18
FLDTYPCD,*FLDTYPCD,,
19
MAPDEN,*MAPDEN,,
20
STDAGE,*STDAGE,,
21
STDSZCD,*STDSZCD,,
22
FLDSZCD,*FLDSZCD,,
23
SITECLCD,*SITECLCD,,
24
SICOND,*SICOND,,
25
SIBASE,*SIBASE,,
26
SISP,*SISP,,
27
STDORGCD,*STDORGCD,,
28
STDORGSP,*STDORGSP,,
29
PROP_BASIS,*PROP_BASIS,,
30
CONDPROP_UNADJ,*CONDPROP_UNADJ,,
31
MICRPROP_UNADJ,*MICRPROP_UNADJ,,
32
SUBPPROP_UNADJ,*SUBPPROP_UNADJ,,
33
MACRPROP_UNADJ,*MACRPROP_UNADJ,,
34
SLOPE,*SLOPE,,
35
ASPECT,*ASPECT,,
36
PHYSCLCD,*PHYSCLCD,,
37
GSSTKCD,*GSSTKCD,,
38
ALSTKCD,*ALSTKCD,,
39
DSTRBCD1,*DSTRBCD1,,
40
DSTRBYR1,*DSTRBYR1,,
41
DSTRBCD2,*DSTRBCD2,,
42
DSTRBYR2,*DSTRBYR2,,
43
DSTRBCD3,*DSTRBCD3,,
44
DSTRBYR3,*DSTRBYR3,,
45
TRTCD1,*TRTCD1,,
46
TRTYR1,*TRTYR1,,
47
TRTCD2,*TRTCD2,,
48
TRTYR2,*TRTYR2,,
49
TRTCD3,*TRTCD3,,
50
TRTYR3,*TRTYR3,,
51
PRESNFCD,*PRESNFCD,,
52
BALIVE,*BALIVE,,
53
FLDAGE,*FLDAGE,,
54
ALSTK,*ALSTK,,
55
GSSTK,*GSSTK,,
56
FORTYPCDCALC,*FORTYPCDCALC,,
57
HABTYPCD1,*HABTYPCD1,,
58
HABTYPCD1_PUB_CD,*HABTYPCD1_PUB_CD,,
59
HABTYPCD1_DESCR_PUB_CD,*HABTYPCD1_DESCR_PUB_CD,,
60
HABTYPCD2,*HABTYPCD2,,
61
HABTYPCD2_PUB_CD,*HABTYPCD2_PUB_CD,,
62
HABTYPCD2_DESCR_PUB_CD,*HABTYPCD2_DESCR_PUB_CD,,
63
MIXEDCONFCD,*MIXEDCONFCD,,
64
VOL_LOC_GRP,*VOL_LOC_GRP,,
65
SITECLCDEST,*SITECLCDEST,,
66
SITETREE_TREE,*SITETREE_TREE,,
67
SITECL_METHOD,*SITECL_METHOD,,
68
CARBON_DOWN_DEAD,*CARBON_DOWN_DEAD,,
69
CARBON_LITTER,*CARBON_LITTER,,
70
CARBON_SOIL_ORG,*CARBON_SOIL_ORG,,
71
CARBON_STANDING_DEAD,*CARBON_STANDING_DEAD,,
72
CARBON_UNDERSTORY_AG,*CARBON_UNDERSTORY_AG,,
73
CARBON_UNDERSTORY_BG,*CARBON_UNDERSTORY_BG,,
74
CREATED_BY,*CREATED_BY,,
75
CREATED_DATE,*CREATED_DATE,,
76
CREATED_IN_INSTANCE,*CREATED_IN_INSTANCE,,
77
MODIFIED_BY,*MODIFIED_BY,,
78
MODIFIED_DATE,*MODIFIED_DATE,,
79
MODIFIED_IN_INSTANCE,*MODIFIED_IN_INSTANCE,,
80
CYCLE,*CYCLE,,
81
SUBCYCLE,*SUBCYCLE,,
82
SOIL_ROOTING_DEPTH_PNW,*SOIL_ROOTING_DEPTH_PNW,,
83
GROUND_LAND_CLASS_PNW,*GROUND_LAND_CLASS_PNW,,
84
PLANT_STOCKABILITY_FACTOR_PNW,*PLANT_STOCKABILITY_FACTOR_PNW,,
85
STND_COND_CD_PNWRS,*STND_COND_CD_PNWRS,,
86
STND_STRUC_CD_PNWRS,*STND_STRUC_CD_PNWRS,,
87
STUMP_CD_PNWRS,*STUMP_CD_PNWRS,,
88
FIRE_SRS,*FIRE_SRS,,
89
GRAZING_SRS,*GRAZING_SRS,,
90
HARVEST_TYPE1_SRS,*HARVEST_TYPE1_SRS,,
91
HARVEST_TYPE2_SRS,*HARVEST_TYPE2_SRS,,
92
HARVEST_TYPE3_SRS,*HARVEST_TYPE3_SRS,,
93
LAND_USE_SRS,*LAND_USE_SRS,,
94
OPERABILITY_SRS,*OPERABILITY_SRS,,
95
STAND_STRUCTURE_SRS,*STAND_STRUCTURE_SRS,,
96
oldgrowth,oldGrowth,,
97
Index_CN_index,*Index_CN_index,,
98
Index_PLT_CN_index,*Index_PLT_CN_index,,
99
Index_4_index,*Index_4_index,,
100
Index_5_index,*Index_5_index,,
101
Index_6_index,*Index_6_index,,
102
Index_7_index,*Index_7_index,,
103
Index_oldgrowth_index,*Index_oldgrowth_index,,
inputs/FIA/FIA_COND_unique/test.xml.ref
1
Put template:
2
<VegBIEN>
3
    <_setDefault id="-1">
4
        <source_id><source><shortname>FIA</shortname></source></source_id>
5
        <path>
6
            <_simplifyPath>
7
                <next>parent_id</next>
8
                <path>
9
                    <location>
10
                        <authorlocationcode>$PLOT</authorlocationcode>
11
                        <sourceaccessioncode>$PLT_CN</sourceaccessioncode>
12
                        <iscultivated><_not><value>$oldgrowth</value></_not></iscultivated>
13
                        <locationevent><authoreventcode>$CONDID</authoreventcode></locationevent>
14
                    </location>
15
                </path>
16
            </_simplifyPath>
17
        </path>
18
    </_setDefault>
19
</VegBIEN>
20
Inserted 5 new rows into database
inputs/FIA/FIA_COND_unique/VegBIEN.csv
1
FIA,VegBIEN:/_setDefault:[source_id/source/shortname/_env:[name=source]]/path/_simplifyPath:[next=parent_id]/path,Comments
2
PLOT,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/1",
3
PLT_CN,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/2/_if[@name=""if locationID""]/cond/_exists",
4
CONDID,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/2/_if[@name=""if locationID""]/else",
5
PLT_CN,"/location/_if[@name=""if subplot""]/else/sourceaccessioncode",
6
PLOT,"/location/_if[@name=""if subplot""]/then/parent_id/location/authorlocationcode",
7
PLT_CN,"/location/_if[@name=""if subplot""]/then/parent_id/location/sourceaccessioncode",
8
oldgrowth,"/location/iscultivated/_or/1/_if[@name=""if TaxonOccurrence""]/else/_alt/1/_not/value",
9
CONDID,"/location/locationevent/_if[@name=""if subplot""]/else/authoreventcode",
10
CONDID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
11
PLOT,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/then",
12
PLT_CN,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
13
CONDID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/authoreventcode",
14
CONDID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
15
PLOT,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
16
PLT_CN,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
17
oldgrowth,"/location/locationevent/taxonoccurrence/iscultivated/_alt/1/_if[@name=""if TaxonOccurrence""]/then/_alt/1/_not/value",
18
PLT_CN,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/cond/_exists",
19
PLT_CN,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/then/_if[@name=""if subplot""]/then/_join/1",
20
ADFORCD,,** No join mapping for *ADFORCD ** 
21
ALSTK,,** No join mapping for *ALSTK ** 
22
ALSTKCD,,** No join mapping for *ALSTKCD ** 
23
ASPECT,,** No join mapping for *ASPECT ** 
24
BALIVE,,** No join mapping for *BALIVE ** 
25
CARBON_DOWN_DEAD,,** No join mapping for *CARBON_DOWN_DEAD ** 
26
CARBON_LITTER,,** No join mapping for *CARBON_LITTER ** 
27
CARBON_SOIL_ORG,,** No join mapping for *CARBON_SOIL_ORG ** 
28
CARBON_STANDING_DEAD,,** No join mapping for *CARBON_STANDING_DEAD ** 
29
CARBON_UNDERSTORY_AG,,** No join mapping for *CARBON_UNDERSTORY_AG ** 
30
CARBON_UNDERSTORY_BG,,** No join mapping for *CARBON_UNDERSTORY_BG ** 
31
CN,,** No join mapping for *CN ** 
32
CONDPROP_UNADJ,,** No join mapping for *CONDPROP_UNADJ ** 
33
COND_NONSAMPLE_REASN_CD,,** No join mapping for *COND_NONSAMPLE_REASN_CD ** 
34
COND_STATUS_CD,,** No join mapping for *COND_STATUS_CD ** 
35
COUNTYCD,,** No join mapping for *COUNTYCD ** 
36
CREATED_BY,,** No join mapping for *CREATED_BY ** 
37
CREATED_DATE,,** No join mapping for *CREATED_DATE ** 
38
CREATED_IN_INSTANCE,,** No join mapping for *CREATED_IN_INSTANCE ** 
39
CYCLE,,** No join mapping for *CYCLE ** 
40
DSTRBCD1,,** No join mapping for *DSTRBCD1 ** 
41
DSTRBCD2,,** No join mapping for *DSTRBCD2 ** 
42
DSTRBCD3,,** No join mapping for *DSTRBCD3 ** 
43
DSTRBYR1,,** No join mapping for *DSTRBYR1 ** 
44
DSTRBYR2,,** No join mapping for *DSTRBYR2 ** 
45
DSTRBYR3,,** No join mapping for *DSTRBYR3 ** 
46
FIRE_SRS,,** No join mapping for *FIRE_SRS ** 
47
FLDAGE,,** No join mapping for *FLDAGE ** 
48
FLDSZCD,,** No join mapping for *FLDSZCD ** 
49
FLDTYPCD,,** No join mapping for *FLDTYPCD ** 
50
FORINDCD,,** No join mapping for *FORINDCD ** 
51
FORTYPCD,,** No join mapping for *FORTYPCD ** 
52
FORTYPCDCALC,,** No join mapping for *FORTYPCDCALC ** 
53
GRAZING_SRS,,** No join mapping for *GRAZING_SRS ** 
54
GROUND_LAND_CLASS_PNW,,** No join mapping for *GROUND_LAND_CLASS_PNW ** 
55
GSSTK,,** No join mapping for *GSSTK ** 
56
GSSTKCD,,** No join mapping for *GSSTKCD ** 
57
HABTYPCD1,,** No join mapping for *HABTYPCD1 ** 
58
HABTYPCD1_DESCR_PUB_CD,,** No join mapping for *HABTYPCD1_DESCR_PUB_CD ** 
59
HABTYPCD1_PUB_CD,,** No join mapping for *HABTYPCD1_PUB_CD ** 
60
HABTYPCD2,,** No join mapping for *HABTYPCD2 ** 
61
HABTYPCD2_DESCR_PUB_CD,,** No join mapping for *HABTYPCD2_DESCR_PUB_CD ** 
62
HABTYPCD2_PUB_CD,,** No join mapping for *HABTYPCD2_PUB_CD ** 
63
HARVEST_TYPE1_SRS,,** No join mapping for *HARVEST_TYPE1_SRS ** 
64
HARVEST_TYPE2_SRS,,** No join mapping for *HARVEST_TYPE2_SRS ** 
65
HARVEST_TYPE3_SRS,,** No join mapping for *HARVEST_TYPE3_SRS ** 
66
INVYR,,** No join mapping for *INVYR ** 
67
Index_4_index,,** No join mapping for *Index_4_index ** 
68
Index_5_index,,** No join mapping for *Index_5_index ** 
69
Index_6_index,,** No join mapping for *Index_6_index ** 
70
Index_7_index,,** No join mapping for *Index_7_index ** 
71
Index_CN_index,,** No join mapping for *Index_CN_index ** 
72
Index_PLT_CN_index,,** No join mapping for *Index_PLT_CN_index ** 
73
Index_oldgrowth_index,,** No join mapping for *Index_oldgrowth_index ** 
74
LAND_USE_SRS,,** No join mapping for *LAND_USE_SRS ** 
75
MACRPROP_UNADJ,,** No join mapping for *MACRPROP_UNADJ ** 
76
MAPDEN,,** No join mapping for *MAPDEN ** 
77
MICRPROP_UNADJ,,** No join mapping for *MICRPROP_UNADJ ** 
78
MIXEDCONFCD,,** No join mapping for *MIXEDCONFCD ** 
79
MODIFIED_BY,,** No join mapping for *MODIFIED_BY ** 
80
MODIFIED_DATE,,** No join mapping for *MODIFIED_DATE ** 
81
MODIFIED_IN_INSTANCE,,** No join mapping for *MODIFIED_IN_INSTANCE ** 
82
OPERABILITY_SRS,,** No join mapping for *OPERABILITY_SRS ** 
83
OWNCD,,** No join mapping for *OWNCD ** 
84
OWNGRPCD,,** No join mapping for *OWNGRPCD ** 
85
PHYSCLCD,,** No join mapping for *PHYSCLCD ** 
86
PLANT_STOCKABILITY_FACTOR_PNW,,** No join mapping for *PLANT_STOCKABILITY_FACTOR_PNW ** 
87
PRESNFCD,,** No join mapping for *PRESNFCD ** 
88
PROP_BASIS,,** No join mapping for *PROP_BASIS ** 
89
RESERVCD,,** No join mapping for *RESERVCD ** 
90
SIBASE,,** No join mapping for *SIBASE ** 
91
SICOND,,** No join mapping for *SICOND ** 
92
SISP,,** No join mapping for *SISP ** 
93
SITECLCD,,** No join mapping for *SITECLCD ** 
94
SITECLCDEST,,** No join mapping for *SITECLCDEST ** 
95
SITECL_METHOD,,** No join mapping for *SITECL_METHOD ** 
96
SITETREE_TREE,,** No join mapping for *SITETREE_TREE ** 
97
SLOPE,,** No join mapping for *SLOPE ** 
98
SOIL_ROOTING_DEPTH_PNW,,** No join mapping for *SOIL_ROOTING_DEPTH_PNW ** 
99
STAND_STRUCTURE_SRS,,** No join mapping for *STAND_STRUCTURE_SRS ** 
100
STATECD,,** No join mapping for *STATECD ** 
101
STDAGE,,** No join mapping for *STDAGE ** 
102
STDORGCD,,** No join mapping for *STDORGCD ** 
103
STDORGSP,,** No join mapping for *STDORGSP ** 
104
STDSZCD,,** No join mapping for *STDSZCD ** 
105
STND_COND_CD_PNWRS,,** No join mapping for *STND_COND_CD_PNWRS ** 
106
STND_STRUC_CD_PNWRS,,** No join mapping for *STND_STRUC_CD_PNWRS ** 
107
STUMP_CD_PNWRS,,** No join mapping for *STUMP_CD_PNWRS ** 
108
SUBCYCLE,,** No join mapping for *SUBCYCLE ** 
109
SUBPPROP_UNADJ,,** No join mapping for *SUBPPROP_UNADJ ** 
110
TRTCD1,,** No join mapping for *TRTCD1 ** 
111
TRTCD2,,** No join mapping for *TRTCD2 ** 
112
TRTCD3,,** No join mapping for *TRTCD3 ** 
113
TRTYR1,,** No join mapping for *TRTYR1 ** 
114
TRTYR2,,** No join mapping for *TRTYR2 ** 
115
TRTYR3,,** No join mapping for *TRTYR3 ** 
116
UNITCD,,** No join mapping for *UNITCD ** 
117
VOL_LOC_GRP,,** No join mapping for *VOL_LOC_GRP ** 
inputs/FIA/FIA_COND_unique/new_terms.csv
1
PLT_CN,locationID,,
2
PLOT,locationName,,
3
CONDID,authorEventCode,,
inputs/FIA/FIA_COND_unique/unmapped_terms.csv
1
*CN
2
*INVYR
3
*STATECD
4
*UNITCD
5
*COUNTYCD
6
*COND_STATUS_CD
7
*COND_NONSAMPLE_REASN_CD
8
*RESERVCD
9
*OWNCD
10
*OWNGRPCD
11
*FORINDCD
12
*ADFORCD
13
*FORTYPCD
14
*FLDTYPCD
15
*MAPDEN
16
*STDAGE
17
*STDSZCD
18
*FLDSZCD
19
*SITECLCD
20
*SICOND
21
*SIBASE
22
*SISP
23
*STDORGCD
24
*STDORGSP
25
*PROP_BASIS
26
*CONDPROP_UNADJ
27
*MICRPROP_UNADJ
28
*SUBPPROP_UNADJ
29
*MACRPROP_UNADJ
30
*SLOPE
31
*ASPECT
32
*PHYSCLCD
33
*GSSTKCD
34
*ALSTKCD
35
*DSTRBCD1
36
*DSTRBYR1
37
*DSTRBCD2
38
*DSTRBYR2
39
*DSTRBCD3
40
*DSTRBYR3
41
*TRTCD1
42
*TRTYR1
43
*TRTCD2
44
*TRTYR2
45
*TRTCD3
46
*TRTYR3
47
*PRESNFCD
48
*BALIVE
49
*FLDAGE
50
*ALSTK
51
*GSSTK
52
*FORTYPCDCALC
53
*HABTYPCD1
54
*HABTYPCD1_PUB_CD
55
*HABTYPCD1_DESCR_PUB_CD
56
*HABTYPCD2
57
*HABTYPCD2_PUB_CD
58
*HABTYPCD2_DESCR_PUB_CD
59
*MIXEDCONFCD
60
*VOL_LOC_GRP
61
*SITECLCDEST
62
*SITETREE_TREE
63
*SITECL_METHOD
64
*CARBON_DOWN_DEAD
65
*CARBON_LITTER
66
*CARBON_SOIL_ORG
67
*CARBON_STANDING_DEAD
68
*CARBON_UNDERSTORY_AG
69
*CARBON_UNDERSTORY_BG
70
*CREATED_BY
71
*CREATED_DATE
72
*CREATED_IN_INSTANCE
73
*MODIFIED_BY
74
*MODIFIED_DATE
75
*MODIFIED_IN_INSTANCE
76
*CYCLE
77
*SUBCYCLE
78
*SOIL_ROOTING_DEPTH_PNW
79
*GROUND_LAND_CLASS_PNW
80
*PLANT_STOCKABILITY_FACTOR_PNW
81
*STND_COND_CD_PNWRS
82
*STND_STRUC_CD_PNWRS
83
*STUMP_CD_PNWRS
84
*FIRE_SRS
85
*GRAZING_SRS
86
*HARVEST_TYPE1_SRS
87
*HARVEST_TYPE2_SRS
88
*HARVEST_TYPE3_SRS
89
*LAND_USE_SRS
90
*OPERABILITY_SRS
91
*STAND_STRUCTURE_SRS
92
*Index_CN_index
93
*Index_PLT_CN_index
94
*Index_4_index
95
*Index_5_index
96
*Index_6_index
97
*Index_7_index
98
*Index_oldgrowth_index
inputs/FIA/_archive/Organism/VegBIEN.csv
1
FIA,VegBIEN:/_setDefault:[source_id/source/shortname/_env:[name=source]]/path/_simplifyPath:[next=parent_id]/path,Comments
2
PlotCD,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/2/_if[@name=""if locationID""]/cond/_exists",
3
PlotCD,"/location/_if[@name=""if subplot""]/else/sourceaccessioncode",
4
PlotCD,"/location/_if[@name=""if subplot""]/then/parent_id/location/sourceaccessioncode",
5
PlotCD,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
6
MeasDay,"/location/locationevent/taxonoccurrence/aggregateoccurrence/collectiondate/_alt/2/_date/day/_nullIf:[null=0,type=float]/value",
7
MeasMon,"/location/locationevent/taxonoccurrence/aggregateoccurrence/collectiondate/_alt/2/_date/month/_nullIf:[null=0,type=float]/value",
8
MeasYear,"/location/locationevent/taxonoccurrence/aggregateoccurrence/collectiondate/_alt/2/_date/year/_nullIf:[null=0,type=float]/value",
9
BasalDiameter,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/basaldiameter_m/_in_to_m/value,Assuming units are the same as for DBH because the values are similar and they measure the same dimension
10
DBH,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/diameterbreastheight_m/_in_to_m/value,Assuming units based on the range and precision of values and location inside the U.S.
11
Height,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/height_m/_ft_to_m/value,"Assuming units based on the range of values, the height of the tallest tree [1], and location inside the U.S.
12

  
13
[1] ""The tallest living tree is believed to be a coast redwood [which] is 115.66 metres (379.5 ft) tall"" (http://en.wikipedia.org/wiki/Tree#Superlative_trees)"
14
TreeTag,/location/locationevent/taxonoccurrence/aggregateoccurrence/plantobservation/stemobservation/tag,
15
PlotCD,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
16
TreeTag,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/then/_first/2/_first/2",
17
SpecificEpithet,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=species]/taxonepithet",
18
Genus,"/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/parent_id/taxonlabel/parent_id/_forEach:[in:[cultivar,forma,variety,subspecies,species,],do=""taxonlabel[rank=_val]/parent_id""]/taxonlabel[rank=genus]/taxonepithet",
19
Genus,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/1/_alt/2/_join_words/2,
20
SpecificEpithet,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/*_id/taxonlabel/taxonomicname/_merge_prefix/value/_alt/2/_join_words/1/_alt/2/_join_words/3/_join_words/1,
21
Genus,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/genus,
22
SpecificEpithet,/location/locationevent/taxonoccurrence/taxondetermination[!isoriginal]/*_id/taxonverbatim/specific_epithet,
23
DecimalLatitude,"/location/locationplace/*_id/place/*_id/coordinates/latitude_deg/_nullIf:[null=0,type=float]/value",
24
DecimalLongitude,"/location/locationplace/*_id/place/*_id/coordinates/longitude_deg/_nullIf:[null=0,type=float]/value",
25
County,/location/locationplace/*_id/place/county,
26
DecimalLatitude,"/location/locationplace/*_id/place/matched_place_id/place:[.,source_id/source/shortname=geoscrub]/*_id/coordinates:[source_id/source/shortname=geoscrub]/_first/2/latitude_deg/_nullIf:[null=0,type=float]/value",""".,"" sorts it with other coordinates mappings"
27
DecimalLongitude,"/location/locationplace/*_id/place/matched_place_id/place:[.,source_id/source/shortname=geoscrub]/*_id/coordinates:[source_id/source/shortname=geoscrub]/_first/2/longitude_deg/_nullIf:[null=0,type=float]/value",""".,"" sorts it with other coordinates mappings"
28
County,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/county/_first/2,
29
StateProvince,/location/locationplace/*_id/place/matched_place_id/place:[source_id/source/shortname=geoscrub]/stateprovince/_first/2,
30
StateProvince,/location/locationplace/*_id/place/stateprovince,
31
PlotCD,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/cond/_exists",
32
PlotCD,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/then/_if[@name=""if subplot""]/then/_join/1",
33
HOM,,** No join mapping for *HOM ** 
inputs/FIA/_archive/Organism/map.csv
1
FIA,VegCore,Filter,Comments
2
TreeTag,tag,,
3
Genus,genus,,
4
SpecificEpithet,specificEpithet,,
5
MeasYear,yearCollected,,
6
MeasMon,monthCollected,,
7
MeasDay,dayCollected,,
8
DecimalLatitude,decimalLatitude,,
9
DecimalLongitude,decimalLongitude,,
10
PlotCD,locationID,,
11
StateProvince,stateProvince,,
12
County,county,,
13
DBH,diameterBreastHeight_in,,Assuming units based on the range and precision of values and location inside the U.S.
14
HOM,*HOM,,
15
BasalDiameter,basalDiameter_in,,Assuming units are the same as for DBH because the values are similar and they measure the same dimension
16
Height,height_ft,,"Assuming units based on the range of values, the height of the tallest tree [1], and location inside the U.S.
17

  
18
[1] ""The tallest living tree is believed to be a coast redwood [which] is 115.66 metres (379.5 ft) tall"" (http://en.wikipedia.org/wiki/Tree#Superlative_trees)"
inputs/FIA/_archive/Organism/import
1
#!/bin/bash
2
# :mode=transact-sql:
3
cd "$(dirname "$0")"
4
. ../../../lib/import.sh
5

  
6
psql <<'EOF'
7
ALTER TABLE :table ALTER COLUMN "PlotCD" TYPE bigint
8
USING "PlotCD"::bigint;
0 9

  
inputs/FIA/_archive/Organism/test.xml.ref
1
Put template:
2
<VegBIEN>
3
    <_setDefault id="-1">
4
        <source_id><source><shortname>FIA</shortname></source></source_id>
5
        <path>
6
            <_simplifyPath>
7
                <next>parent_id</next>
8
                <path>
9
                    <location>
10
                        <sourceaccessioncode>$PlotCD</sourceaccessioncode>
11
                        <locationevent>
12
                            <taxonoccurrence>
13
                                <aggregateoccurrence>
14
                                    <collectiondate>
15
                                        <_date>
16
                                            <day>
17
                                                <_nullIf>
18
                                                    <null>0</null>
19
                                                    <type>float</type>
20
                                                    <value>$MeasDay</value>
21
                                                </_nullIf>
22
                                            </day>
23
                                            <month>
24
                                                <_nullIf>
25
                                                    <null>0</null>
26
                                                    <type>float</type>
27
                                                    <value>$MeasMon</value>
28
                                                </_nullIf>
29
                                            </month>
30
                                            <year>
31
                                                <_nullIf>
32
                                                    <null>0</null>
33
                                                    <type>float</type>
34
                                                    <value>$MeasYear</value>
35
                                                </_nullIf>
36
                                            </year>
37
                                        </_date>
38
                                    </collectiondate>
39
                                    <plantobservation>
40
                                        <stemobservation>
41
                                            <basaldiameter_m><_in_to_m><value>$BasalDiameter</value></_in_to_m></basaldiameter_m>
42
                                            <diameterbreastheight_m><_in_to_m><value>$DBH</value></_in_to_m></diameterbreastheight_m>
43
                                            <height_m><_ft_to_m><value>$Height</value></_ft_to_m></height_m>
44
                                            <tag>$TreeTag</tag>
45
                                        </stemobservation>
46
                                    </plantobservation>
47
                                </aggregateoccurrence>
48
                                <authortaxoncode>$TreeTag</authortaxoncode>
49
                                <taxondetermination>
50
                                    <taxonverbatim_id>
51
                                        <taxonverbatim>
52
                                            <taxonlabel_id>
53
                                                <taxonlabel>
54
                                                    <parent_id>
55
                                                        <taxonlabel>
56
                                                            <parent_id>
57
                                                                <taxonlabel>
58
                                                                    <rank>cultivar</rank>
59
                                                                    <parent_id>
60
                                                                        <taxonlabel>
61
                                                                            <rank>forma</rank>
62
                                                                            <parent_id>
63
                                                                                <taxonlabel>
64
                                                                                    <rank>variety</rank>
65
                                                                                    <parent_id>
66
                                                                                        <taxonlabel>
67
                                                                                            <rank>subspecies</rank>
68
                                                                                            <parent_id>
69
                                                                                                <taxonlabel>
70
                                                                                                    <rank>species</rank>
71
                                                                                                    <taxonepithet>$SpecificEpithet</taxonepithet>
72
                                                                                                    <parent_id>
73
                                                                                                        <taxonlabel>
74
                                                                                                            <rank>genus</rank>
75
                                                                                                            <taxonepithet>$Genus</taxonepithet>
76
                                                                                                        </taxonlabel>
77
                                                                                                    </parent_id>
78
                                                                                                </taxonlabel>
79
                                                                                            </parent_id>
80
                                                                                        </taxonlabel>
81
                                                                                    </parent_id>
82
                                                                                </taxonlabel>
83
                                                                            </parent_id>
84
                                                                        </taxonlabel>
85
                                                                    </parent_id>
86
                                                                </taxonlabel>
87
                                                            </parent_id>
88
                                                        </taxonlabel>
89
                                                    </parent_id>
90
                                                    <taxonomicname>
91
                                                        <_join_words>
92
                                                            <2>$Genus</2>
93
                                                            <3>$SpecificEpithet</3>
94
                                                        </_join_words>
95
                                                    </taxonomicname>
96
                                                </taxonlabel>
97
                                            </taxonlabel_id>
98
                                            <genus>$Genus</genus>
99
                                            <specific_epithet>$SpecificEpithet</specific_epithet>
100
                                        </taxonverbatim>
101
                                    </taxonverbatim_id>
102
                                </taxondetermination>
103
                            </taxonoccurrence>
104
                        </locationevent>
105
                        <locationplace>
106
                            <place_id>
107
                                <place>
108
                                    <coordinates_id>
109
                                        <coordinates>
110
                                            <latitude_deg>
111
                                                <_nullIf>
112
                                                    <null>0</null>
113
                                                    <type>float</type>
114
                                                    <value>$DecimalLatitude</value>
115
                                                </_nullIf>
116
                                            </latitude_deg>
117
                                            <longitude_deg>
118
                                                <_nullIf>
119
                                                    <null>0</null>
120
                                                    <type>float</type>
121
                                                    <value>$DecimalLongitude</value>
122
                                                </_nullIf>
123
                                            </longitude_deg>
124
                                        </coordinates>
125
                                    </coordinates_id>
126
                                    <county>$County</county>
127
                                    <matched_place_id>
128
                                        <place>
129
                                            <source_id><source><shortname>geoscrub</shortname></source></source_id>
130
                                            <coordinates_id>
131
                                                <coordinates>
132
                                                    <source_id><source><shortname>geoscrub</shortname></source></source_id>
133
                                                    <latitude_deg>
134
                                                        <_nullIf>
135
                                                            <null>0</null>
136
                                                            <type>float</type>
137
                                                            <value>$DecimalLatitude</value>
138
                                                        </_nullIf>
139
                                                    </latitude_deg>
140
                                                    <longitude_deg>
141
                                                        <_nullIf>
142
                                                            <null>0</null>
143
                                                            <type>float</type>
144
                                                            <value>$DecimalLongitude</value>
145
                                                        </_nullIf>
146
                                                    </longitude_deg>
147
                                                </coordinates>
148
                                            </coordinates_id>
149
                                            <county>$County</county>
150
                                            <stateprovince>$StateProvince</stateprovince>
151
                                        </place>
152
                                    </matched_place_id>
153
                                    <stateprovince>$StateProvince</stateprovince>
154
                                </place>
155
                            </place_id>
156
                        </locationplace>
157
                    </location>
158
                </path>
159
            </_simplifyPath>
160
        </path>
161
    </_setDefault>
162
</VegBIEN>
163
Inserted 23 new rows into database
inputs/FIA/_archive/Organism/unmapped_terms.csv
1
*HOM
inputs/FIA/_archive/Organism/new_terms.csv
1
TreeTag,tag,,
2
MeasYear,yearCollected,,
3
MeasMon,monthCollected,,
4
MeasDay,dayCollected,,
5
PlotCD,locationID,,
inputs/FIA/_archive/FIA_COND_unique/VegBIEN.csv
1
FIA,VegBIEN:/_setDefault:[source_id/source/shortname/_env:[name=source]]/path/_simplifyPath:[next=parent_id]/path,Comments
2
PLOT,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/1",
3
PLT_CN,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/2/_if[@name=""if locationID""]/cond/_exists",
4
CONDID,"/location/_if[@name=""if subplot""]/else/authorlocationcode/_first/2/_if[@name=""if locationID""]/else",
5
PLT_CN,"/location/_if[@name=""if subplot""]/else/sourceaccessioncode",
6
PLOT,"/location/_if[@name=""if subplot""]/then/parent_id/location/authorlocationcode",
7
PLT_CN,"/location/_if[@name=""if subplot""]/then/parent_id/location/sourceaccessioncode",
8
oldgrowth,"/location/iscultivated/_or/1/_if[@name=""if TaxonOccurrence""]/else/_alt/1/_not/value",
9
CONDID,"/location/locationevent/_if[@name=""if subplot""]/else/authoreventcode",
10
CONDID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/cond/_exists",
11
PLOT,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/authorlocationcode/_if[@name=""if subplot""]/then",
12
PLT_CN,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/*_id/location/sourceaccessioncode/_if[@name=""if subplot""]/then",
13
CONDID,"/location/locationevent/_if[@name=""if subplot""]/then/_if[@name=""if has event""]/then/parent_id/locationevent/authoreventcode",
14
CONDID,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
15
PLOT,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
16
PLT_CN,"/location/locationevent/taxonoccurrence/authortaxoncode/_if[@name=""if in plot""]/cond/_exists",
17
oldgrowth,"/location/locationevent/taxonoccurrence/iscultivated/_alt/1/_if[@name=""if TaxonOccurrence""]/then/_alt/1/_not/value",
18
PLT_CN,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/cond/_exists",
19
PLT_CN,"/location/sourceaccessioncode/_first/2/_if[@name=""if locationID""]/then/_if[@name=""if subplot""]/then/_join/1",
20
ADFORCD,,** No join mapping for *ADFORCD ** 
21
ALSTK,,** No join mapping for *ALSTK ** 
22
ALSTKCD,,** No join mapping for *ALSTKCD ** 
23
ASPECT,,** No join mapping for *ASPECT ** 
24
BALIVE,,** No join mapping for *BALIVE ** 
25
CARBON_DOWN_DEAD,,** No join mapping for *CARBON_DOWN_DEAD ** 
26
CARBON_LITTER,,** No join mapping for *CARBON_LITTER ** 
27
CARBON_SOIL_ORG,,** No join mapping for *CARBON_SOIL_ORG ** 
28
CARBON_STANDING_DEAD,,** No join mapping for *CARBON_STANDING_DEAD ** 
29
CARBON_UNDERSTORY_AG,,** No join mapping for *CARBON_UNDERSTORY_AG ** 
30
CARBON_UNDERSTORY_BG,,** No join mapping for *CARBON_UNDERSTORY_BG ** 
31
CN,,** No join mapping for *CN ** 
32
CONDPROP_UNADJ,,** No join mapping for *CONDPROP_UNADJ ** 
33
COND_NONSAMPLE_REASN_CD,,** No join mapping for *COND_NONSAMPLE_REASN_CD ** 
34
COND_STATUS_CD,,** No join mapping for *COND_STATUS_CD ** 
35
COUNTYCD,,** No join mapping for *COUNTYCD ** 
36
CREATED_BY,,** No join mapping for *CREATED_BY ** 
37
CREATED_DATE,,** No join mapping for *CREATED_DATE ** 
38
CREATED_IN_INSTANCE,,** No join mapping for *CREATED_IN_INSTANCE ** 
39
CYCLE,,** No join mapping for *CYCLE ** 
40
DSTRBCD1,,** No join mapping for *DSTRBCD1 ** 
41
DSTRBCD2,,** No join mapping for *DSTRBCD2 ** 
42
DSTRBCD3,,** No join mapping for *DSTRBCD3 ** 
43
DSTRBYR1,,** No join mapping for *DSTRBYR1 ** 
44
DSTRBYR2,,** No join mapping for *DSTRBYR2 ** 
45
DSTRBYR3,,** No join mapping for *DSTRBYR3 ** 
46
FIRE_SRS,,** No join mapping for *FIRE_SRS ** 
47
FLDAGE,,** No join mapping for *FLDAGE ** 
48
FLDSZCD,,** No join mapping for *FLDSZCD ** 
49
FLDTYPCD,,** No join mapping for *FLDTYPCD ** 
50
FORINDCD,,** No join mapping for *FORINDCD ** 
51
FORTYPCD,,** No join mapping for *FORTYPCD ** 
52
FORTYPCDCALC,,** No join mapping for *FORTYPCDCALC ** 
53
GRAZING_SRS,,** No join mapping for *GRAZING_SRS ** 
54
GROUND_LAND_CLASS_PNW,,** No join mapping for *GROUND_LAND_CLASS_PNW ** 
55
GSSTK,,** No join mapping for *GSSTK ** 
56
GSSTKCD,,** No join mapping for *GSSTKCD ** 
57
HABTYPCD1,,** No join mapping for *HABTYPCD1 ** 
58
HABTYPCD1_DESCR_PUB_CD,,** No join mapping for *HABTYPCD1_DESCR_PUB_CD ** 
59
HABTYPCD1_PUB_CD,,** No join mapping for *HABTYPCD1_PUB_CD ** 
60
HABTYPCD2,,** No join mapping for *HABTYPCD2 ** 
61
HABTYPCD2_DESCR_PUB_CD,,** No join mapping for *HABTYPCD2_DESCR_PUB_CD ** 
62
HABTYPCD2_PUB_CD,,** No join mapping for *HABTYPCD2_PUB_CD ** 
63
HARVEST_TYPE1_SRS,,** No join mapping for *HARVEST_TYPE1_SRS ** 
64
HARVEST_TYPE2_SRS,,** No join mapping for *HARVEST_TYPE2_SRS ** 
65
HARVEST_TYPE3_SRS,,** No join mapping for *HARVEST_TYPE3_SRS ** 
66
INVYR,,** No join mapping for *INVYR ** 
67
Index_4_index,,** No join mapping for *Index_4_index ** 
68
Index_5_index,,** No join mapping for *Index_5_index ** 
69
Index_6_index,,** No join mapping for *Index_6_index ** 
70
Index_7_index,,** No join mapping for *Index_7_index ** 
71
Index_CN_index,,** No join mapping for *Index_CN_index ** 
72
Index_PLT_CN_index,,** No join mapping for *Index_PLT_CN_index ** 
73
Index_oldgrowth_index,,** No join mapping for *Index_oldgrowth_index ** 
74
LAND_USE_SRS,,** No join mapping for *LAND_USE_SRS ** 
75
MACRPROP_UNADJ,,** No join mapping for *MACRPROP_UNADJ ** 
76
MAPDEN,,** No join mapping for *MAPDEN ** 
77
MICRPROP_UNADJ,,** No join mapping for *MICRPROP_UNADJ ** 
78
MIXEDCONFCD,,** No join mapping for *MIXEDCONFCD ** 
79
MODIFIED_BY,,** No join mapping for *MODIFIED_BY ** 
80
MODIFIED_DATE,,** No join mapping for *MODIFIED_DATE ** 
81
MODIFIED_IN_INSTANCE,,** No join mapping for *MODIFIED_IN_INSTANCE ** 
82
OPERABILITY_SRS,,** No join mapping for *OPERABILITY_SRS ** 
83
OWNCD,,** No join mapping for *OWNCD ** 
84
OWNGRPCD,,** No join mapping for *OWNGRPCD ** 
85
PHYSCLCD,,** No join mapping for *PHYSCLCD ** 
86
PLANT_STOCKABILITY_FACTOR_PNW,,** No join mapping for *PLANT_STOCKABILITY_FACTOR_PNW ** 
87
PRESNFCD,,** No join mapping for *PRESNFCD ** 
88
PROP_BASIS,,** No join mapping for *PROP_BASIS ** 
89
RESERVCD,,** No join mapping for *RESERVCD ** 
90
SIBASE,,** No join mapping for *SIBASE ** 
91
SICOND,,** No join mapping for *SICOND ** 
92
SISP,,** No join mapping for *SISP ** 
93
SITECLCD,,** No join mapping for *SITECLCD ** 
94
SITECLCDEST,,** No join mapping for *SITECLCDEST ** 
95
SITECL_METHOD,,** No join mapping for *SITECL_METHOD ** 
96
SITETREE_TREE,,** No join mapping for *SITETREE_TREE ** 
97
SLOPE,,** No join mapping for *SLOPE ** 
98
SOIL_ROOTING_DEPTH_PNW,,** No join mapping for *SOIL_ROOTING_DEPTH_PNW ** 
99
STAND_STRUCTURE_SRS,,** No join mapping for *STAND_STRUCTURE_SRS ** 
100
STATECD,,** No join mapping for *STATECD ** 
101
STDAGE,,** No join mapping for *STDAGE ** 
102
STDORGCD,,** No join mapping for *STDORGCD ** 
103
STDORGSP,,** No join mapping for *STDORGSP ** 
104
STDSZCD,,** No join mapping for *STDSZCD ** 
105
STND_COND_CD_PNWRS,,** No join mapping for *STND_COND_CD_PNWRS ** 
106
STND_STRUC_CD_PNWRS,,** No join mapping for *STND_STRUC_CD_PNWRS ** 
107
STUMP_CD_PNWRS,,** No join mapping for *STUMP_CD_PNWRS ** 
108
SUBCYCLE,,** No join mapping for *SUBCYCLE ** 
109
SUBPPROP_UNADJ,,** No join mapping for *SUBPPROP_UNADJ ** 
110
TRTCD1,,** No join mapping for *TRTCD1 ** 
111
TRTCD2,,** No join mapping for *TRTCD2 ** 
112
TRTCD3,,** No join mapping for *TRTCD3 ** 
113
TRTYR1,,** No join mapping for *TRTYR1 ** 
114
TRTYR2,,** No join mapping for *TRTYR2 ** 
115
TRTYR3,,** No join mapping for *TRTYR3 ** 
116
UNITCD,,** No join mapping for *UNITCD ** 
117
VOL_LOC_GRP,,** No join mapping for *VOL_LOC_GRP ** 
inputs/FIA/_archive/FIA_COND_unique/test.xml.ref
1
Put template:
2
<VegBIEN>
3
    <_setDefault id="-1">
4
        <source_id><source><shortname>FIA</shortname></source></source_id>
5
        <path>
6
            <_simplifyPath>
7
                <next>parent_id</next>
8
                <path>
9
                    <location>
10
                        <authorlocationcode>$PLOT</authorlocationcode>
11
                        <sourceaccessioncode>$PLT_CN</sourceaccessioncode>
12
                        <iscultivated><_not><value>$oldgrowth</value></_not></iscultivated>
13
                        <locationevent><authoreventcode>$CONDID</authoreventcode></locationevent>
14
                    </location>
15
                </path>
16
            </_simplifyPath>
17
        </path>
18
    </_setDefault>
19
</VegBIEN>
20
Inserted 5 new rows into database
inputs/FIA/_archive/FIA_COND_unique/map.csv
1
FIA,VegCore,Filter,Comments
2
CN,*CN,,
3
PLT_CN,locationID,,
4
INVYR,*INVYR,,
5
STATECD,*STATECD,,
6
UNITCD,*UNITCD,,
7
COUNTYCD,*COUNTYCD,,
8
PLOT,locationName,,
9
CONDID,authorEventCode,,
10
COND_STATUS_CD,*COND_STATUS_CD,,
11
COND_NONSAMPLE_REASN_CD,*COND_NONSAMPLE_REASN_CD,,
12
RESERVCD,*RESERVCD,,
13
OWNCD,*OWNCD,,
14
OWNGRPCD,*OWNGRPCD,,
15
FORINDCD,*FORINDCD,,
16
ADFORCD,*ADFORCD,,
17
FORTYPCD,*FORTYPCD,,
18
FLDTYPCD,*FLDTYPCD,,
19
MAPDEN,*MAPDEN,,
20
STDAGE,*STDAGE,,
21
STDSZCD,*STDSZCD,,
22
FLDSZCD,*FLDSZCD,,
23
SITECLCD,*SITECLCD,,
24
SICOND,*SICOND,,
25
SIBASE,*SIBASE,,
26
SISP,*SISP,,
27
STDORGCD,*STDORGCD,,
28
STDORGSP,*STDORGSP,,
29
PROP_BASIS,*PROP_BASIS,,
30
CONDPROP_UNADJ,*CONDPROP_UNADJ,,
31
MICRPROP_UNADJ,*MICRPROP_UNADJ,,
32
SUBPPROP_UNADJ,*SUBPPROP_UNADJ,,
33
MACRPROP_UNADJ,*MACRPROP_UNADJ,,
34
SLOPE,*SLOPE,,
35
ASPECT,*ASPECT,,
36
PHYSCLCD,*PHYSCLCD,,
37
GSSTKCD,*GSSTKCD,,
38
ALSTKCD,*ALSTKCD,,
39
DSTRBCD1,*DSTRBCD1,,
40
DSTRBYR1,*DSTRBYR1,,
41
DSTRBCD2,*DSTRBCD2,,
42
DSTRBYR2,*DSTRBYR2,,
43
DSTRBCD3,*DSTRBCD3,,
44
DSTRBYR3,*DSTRBYR3,,
45
TRTCD1,*TRTCD1,,
46
TRTYR1,*TRTYR1,,
47
TRTCD2,*TRTCD2,,
48
TRTYR2,*TRTYR2,,
49
TRTCD3,*TRTCD3,,
50
TRTYR3,*TRTYR3,,
51
PRESNFCD,*PRESNFCD,,
52
BALIVE,*BALIVE,,
53
FLDAGE,*FLDAGE,,
54
ALSTK,*ALSTK,,
55
GSSTK,*GSSTK,,
56
FORTYPCDCALC,*FORTYPCDCALC,,
57
HABTYPCD1,*HABTYPCD1,,
58
HABTYPCD1_PUB_CD,*HABTYPCD1_PUB_CD,,
59
HABTYPCD1_DESCR_PUB_CD,*HABTYPCD1_DESCR_PUB_CD,,
60
HABTYPCD2,*HABTYPCD2,,
61
HABTYPCD2_PUB_CD,*HABTYPCD2_PUB_CD,,
62
HABTYPCD2_DESCR_PUB_CD,*HABTYPCD2_DESCR_PUB_CD,,
63
MIXEDCONFCD,*MIXEDCONFCD,,
64
VOL_LOC_GRP,*VOL_LOC_GRP,,
65
SITECLCDEST,*SITECLCDEST,,
66
SITETREE_TREE,*SITETREE_TREE,,
67
SITECL_METHOD,*SITECL_METHOD,,
68
CARBON_DOWN_DEAD,*CARBON_DOWN_DEAD,,
69
CARBON_LITTER,*CARBON_LITTER,,
70
CARBON_SOIL_ORG,*CARBON_SOIL_ORG,,
71
CARBON_STANDING_DEAD,*CARBON_STANDING_DEAD,,
72
CARBON_UNDERSTORY_AG,*CARBON_UNDERSTORY_AG,,
73
CARBON_UNDERSTORY_BG,*CARBON_UNDERSTORY_BG,,
74
CREATED_BY,*CREATED_BY,,
75
CREATED_DATE,*CREATED_DATE,,
76
CREATED_IN_INSTANCE,*CREATED_IN_INSTANCE,,
77
MODIFIED_BY,*MODIFIED_BY,,
78
MODIFIED_DATE,*MODIFIED_DATE,,
79
MODIFIED_IN_INSTANCE,*MODIFIED_IN_INSTANCE,,
80
CYCLE,*CYCLE,,
81
SUBCYCLE,*SUBCYCLE,,
82
SOIL_ROOTING_DEPTH_PNW,*SOIL_ROOTING_DEPTH_PNW,,
83
GROUND_LAND_CLASS_PNW,*GROUND_LAND_CLASS_PNW,,
84
PLANT_STOCKABILITY_FACTOR_PNW,*PLANT_STOCKABILITY_FACTOR_PNW,,
85
STND_COND_CD_PNWRS,*STND_COND_CD_PNWRS,,
86
STND_STRUC_CD_PNWRS,*STND_STRUC_CD_PNWRS,,
87
STUMP_CD_PNWRS,*STUMP_CD_PNWRS,,
88
FIRE_SRS,*FIRE_SRS,,
89
GRAZING_SRS,*GRAZING_SRS,,
90
HARVEST_TYPE1_SRS,*HARVEST_TYPE1_SRS,,
91
HARVEST_TYPE2_SRS,*HARVEST_TYPE2_SRS,,
92
HARVEST_TYPE3_SRS,*HARVEST_TYPE3_SRS,,
93
LAND_USE_SRS,*LAND_USE_SRS,,
94
OPERABILITY_SRS,*OPERABILITY_SRS,,
95
STAND_STRUCTURE_SRS,*STAND_STRUCTURE_SRS,,
96
oldgrowth,oldGrowth,,
97
Index_CN_index,*Index_CN_index,,
98
Index_PLT_CN_index,*Index_PLT_CN_index,,
99
Index_4_index,*Index_4_index,,
100
Index_5_index,*Index_5_index,,
101
Index_6_index,*Index_6_index,,
102
Index_7_index,*Index_7_index,,
103
Index_oldgrowth_index,*Index_oldgrowth_index,,
inputs/FIA/_archive/FIA_COND_unique/new_terms.csv
1
PLT_CN,locationID,,
2
PLOT,locationName,,
3
CONDID,authorEventCode,,
inputs/FIA/_archive/FIA_COND_unique/unmapped_terms.csv
1
*CN
2
*INVYR
3
*STATECD
4
*UNITCD
5
*COUNTYCD
6
*COND_STATUS_CD
7
*COND_NONSAMPLE_REASN_CD
8
*RESERVCD
9
*OWNCD
10
*OWNGRPCD
11
*FORINDCD
12
*ADFORCD
13
*FORTYPCD
14
*FLDTYPCD
15
*MAPDEN
16
*STDAGE
17
*STDSZCD
18
*FLDSZCD
19
*SITECLCD
20
*SICOND
21
*SIBASE
22
*SISP
23
*STDORGCD
24
*STDORGSP
25
*PROP_BASIS
26
*CONDPROP_UNADJ
27
*MICRPROP_UNADJ
28
*SUBPPROP_UNADJ
29
*MACRPROP_UNADJ
30
*SLOPE
31
*ASPECT
32
*PHYSCLCD
33
*GSSTKCD
34
*ALSTKCD
35
*DSTRBCD1
36
*DSTRBYR1
37
*DSTRBCD2
38
*DSTRBYR2
39
*DSTRBCD3
40
*DSTRBYR3
41
*TRTCD1
42
*TRTYR1
43
*TRTCD2
44
*TRTYR2
45
*TRTCD3
46
*TRTYR3
47
*PRESNFCD
48
*BALIVE
49
*FLDAGE
50
*ALSTK
51
*GSSTK
52
*FORTYPCDCALC
53
*HABTYPCD1
54
*HABTYPCD1_PUB_CD
55
*HABTYPCD1_DESCR_PUB_CD
56
*HABTYPCD2
57
*HABTYPCD2_PUB_CD
58
*HABTYPCD2_DESCR_PUB_CD
59
*MIXEDCONFCD
60
*VOL_LOC_GRP
61
*SITECLCDEST
62
*SITETREE_TREE
63
*SITECL_METHOD
64
*CARBON_DOWN_DEAD
65
*CARBON_LITTER
66
*CARBON_SOIL_ORG
67
*CARBON_STANDING_DEAD
68
*CARBON_UNDERSTORY_AG
69
*CARBON_UNDERSTORY_BG
70
*CREATED_BY
71
*CREATED_DATE
72
*CREATED_IN_INSTANCE
73
*MODIFIED_BY
74
*MODIFIED_DATE
75
*MODIFIED_IN_INSTANCE
76
*CYCLE
77
*SUBCYCLE
78
*SOIL_ROOTING_DEPTH_PNW
79
*GROUND_LAND_CLASS_PNW
80
*PLANT_STOCKABILITY_FACTOR_PNW
81
*STND_COND_CD_PNWRS
82
*STND_STRUC_CD_PNWRS
83
*STUMP_CD_PNWRS
84
*FIRE_SRS
85
*GRAZING_SRS
86
*HARVEST_TYPE1_SRS
87
*HARVEST_TYPE2_SRS
88
*HARVEST_TYPE3_SRS
89
*LAND_USE_SRS
90
*OPERABILITY_SRS
91
*STAND_STRUCTURE_SRS
92
*Index_CN_index
93
*Index_PLT_CN_index
94
*Index_4_index
95
*Index_5_index
96
*Index_6_index
97
*Index_7_index
98
*Index_oldgrowth_index
inputs/FIA/_archive/FIA_COND_unique/create.sql
1
SELECT
2
DISTINCT ON ("PLT_CN")
3
*
4
FROM "FIA_COND"
5
;
6

  
7
ALTER TABLE :table ADD PRIMARY KEY ("PLT_CN");
8

  
9
--ALTER TABLE :table ADD COLUMN oldgrowth boolean;
10
ALTER TABLE :table ALTER COLUMN oldgrowth TYPE boolean
11
USING
12
(
13
"STDAGE">80 
14
AND ("TRTCD1"='0' OR "TRTCD1" IS NULL)
15
AND (("DSTRBCD1"<>'30' AND "DSTRBCD1"<>'31' AND "DSTRBCD1"<>'32' AND "DSTRBCD1"<>'80') OR "DSTRBCD1" IS NULL)
16
AND ("STUMP_CD_PNWRS"='N' OR "STUMP_CD_PNWRS" IS NULL)
17
AND "HARVEST_TYPE1_SRS" IS NULL
18
AND "PRESNFCD" IS NULL
19
AND ("STDORGCD"=0 OR "STDORGCD" IS NULL)
20
)
21
OR "STND_COND_CD_PNWRS"='7'
22
;
inputs/FIA/_archive/FIA_COND_unique/header.csv
1
CN,PLT_CN,INVYR,STATECD,UNITCD,COUNTYCD,PLOT,CONDID,COND_STATUS_CD,COND_NONSAMPLE_REASN_CD,RESERVCD,OWNCD,OWNGRPCD,FORINDCD,ADFORCD,FORTYPCD,FLDTYPCD,MAPDEN,STDAGE,STDSZCD,FLDSZCD,SITECLCD,SICOND,SIBASE,SISP,STDORGCD,STDORGSP,PROP_BASIS,CONDPROP_UNADJ,MICRPROP_UNADJ,SUBPPROP_UNADJ,MACRPROP_UNADJ,SLOPE,ASPECT,PHYSCLCD,GSSTKCD,ALSTKCD,DSTRBCD1,DSTRBYR1,DSTRBCD2,DSTRBYR2,DSTRBCD3,DSTRBYR3,TRTCD1,TRTYR1,TRTCD2,TRTYR2,TRTCD3,TRTYR3,PRESNFCD,BALIVE,FLDAGE,ALSTK,GSSTK,FORTYPCDCALC,HABTYPCD1,HABTYPCD1_PUB_CD,HABTYPCD1_DESCR_PUB_CD,HABTYPCD2,HABTYPCD2_PUB_CD,HABTYPCD2_DESCR_PUB_CD,MIXEDCONFCD,VOL_LOC_GRP,SITECLCDEST,SITETREE_TREE,SITECL_METHOD,CARBON_DOWN_DEAD,CARBON_LITTER,CARBON_SOIL_ORG,CARBON_STANDING_DEAD,CARBON_UNDERSTORY_AG,CARBON_UNDERSTORY_BG,CREATED_BY,CREATED_DATE,CREATED_IN_INSTANCE,MODIFIED_BY,MODIFIED_DATE,MODIFIED_IN_INSTANCE,CYCLE,SUBCYCLE,SOIL_ROOTING_DEPTH_PNW,GROUND_LAND_CLASS_PNW,PLANT_STOCKABILITY_FACTOR_PNW,STND_COND_CD_PNWRS,STND_STRUC_CD_PNWRS,STUMP_CD_PNWRS,FIRE_SRS,GRAZING_SRS,HARVEST_TYPE1_SRS,HARVEST_TYPE2_SRS,HARVEST_TYPE3_SRS,LAND_USE_SRS,OPERABILITY_SRS,STAND_STRUCTURE_SRS,oldgrowth,Index_CN_index,Index_PLT_CN_index,Index_4_index,Index_5_index,Index_6_index,Index_7_index,Index_oldgrowth_index

Also available in: Unified diff