@ca-plant-list/ca-plant-list 0.4.27 → 0.4.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/exceptions.json +0 -27
- package/data/genera.json +52 -28
- package/data/glossary/anther.md +3 -0
- package/data/glossary/filament.md +3 -0
- package/data/glossary/stamen.md +3 -0
- package/data/illustrations/inkscape/stamen.svg +132 -0
- package/data/inatobsphotos.csv +0 -5
- package/data/inattaxonphotos.csv +69 -64
- package/data/synonyms.csv +155 -164
- package/data/taxa.csv +38 -39
- package/data/text/Dichelostemma-congestum.md +1 -0
- package/data/text/Dipterostemon-capitatus-subsp-capitatus.md +1 -0
- package/lib/taxonomy/taxon.js +5 -1
- package/lib/tools/cch2.js +37 -18
- package/lib/tools/jepsonfamilies.js +1 -1
- package/package.json +1 -1
- package/scripts/cpl-photos.js +61 -24
- package/scripts/cpl-tools.js +4 -1
package/data/taxa.csv
CHANGED
@@ -174,7 +174,7 @@ Astragalus asymmetricus,San Joaquin milkvetch,N,14702,803,58145,10685,,San Joaqu
|
|
174
174
|
Astragalus breweri,,N,14733,810,75628,10717,,Brewer's Milkvetch,,,,,297,4.2,,,S3,G3
|
175
175
|
Astragalus didymocarpus var. didymocarpus,two-seeded milkvetch,N,54711,827,58895,44840,,Dwarf White Milkvetch
|
176
176
|
Astragalus gambelianus,little blue loco,N,14840,838,57042,10856,,Gambel's Dwarf Milk Vetch
|
177
|
-
Astragalus nuttallii var. nuttallii,,N,54881,897,80423,45033,,Ocean Bluff Milkvetch,,,,,1825,4.
|
177
|
+
Astragalus nuttallii var. nuttallii,,N,54881,897,80423,45033,,Ocean Bluff Milkvetch,,,,,1825,4.3,,,S4,G4T4
|
178
178
|
Astragalus nuttallii var. virgatus,,N,54882,898,80424,45034,,Angel Island Milkwort
|
179
179
|
Astragalus tener var. tener,alkali milkvetch,N,54950,940,80442,45116,,Alkali Milkvetch,,,,,1129,1B.2,,,S1,G2T1
|
180
180
|
Athyrium filix-femina var. cyclosorum,western lady fern,N,54990,959,61002,201218,true,Lady Fern
|
@@ -265,6 +265,7 @@ Calandrinia breweri,,N,16614,1249,68636,112280,true,Brewer's Calandrinia,,,,,180
|
|
265
265
|
Calandrinia menziesii,red maids,N,95066,13205,400267,202564,,Red Maids
|
266
266
|
Calendula arvensis,field-marigold,X,1862,1252,59260,202566,true
|
267
267
|
Calendula officinalis,pot-marigold,X,1863,1253,75931,202567,true
|
268
|
+
Calibrachoa parviflora,wild petunia,U,16635,6279,159650,64106
|
268
269
|
California macrophylla,,N,80427,10468,60554,11982,,Round-leaved Filaree
|
269
270
|
Callitriche heterophylla var. bolanderi,,N,55448,1257,60158,96979,,Bolander's Water-starwort
|
270
271
|
Callitriche longipedunculata,,N,16691,11443,75936,64127,true,Longstock Water-starwort
|
@@ -302,9 +303,6 @@ Camissoniopsis cheiranthifolia subsp. cheiranthifolia,dune suncup,N,89240,11448,
|
|
302
303
|
Camissoniopsis hirtella,,N,89201,11453,75980,12187,true,Santa Cruz Island Suncup
|
303
304
|
Camissoniopsis intermedia,,N,89203,11455,75982,12189,true,Intermediate Suncup
|
304
305
|
Camissoniopsis micrantha,,N,89206,11458,75985,12192,true,Small Flowered Evening Primrose
|
305
|
-
Campanula exigua,chaparral harebell,N,16965,1461,1342787,202687,,Chaparral Harebell,,,,,265,1B.2,,,S2,G2
|
306
|
-
Campanula griffinii,,N,16970,1462,1342789,202688,,Griffin's Bellflower
|
307
|
-
Campanula sharsmithiae,,N,16995,1467,1342786,208086,,Sharsmith's Harebell,,,,,267,1B.2,,,S1S2,G1G2
|
308
306
|
Capsella bursa-pastoris,shepherd's purse,X,17109,1472,56121,12296,true
|
309
307
|
Cardamine californica,"milkmaids,tooth wort",N,76456,1479,49651,12325,true,Milk Maids
|
310
308
|
Cardamine hirsuta,,X,17158,1486,55829,12347,true
|
@@ -497,13 +495,11 @@ Crocidium multicaule,spring gold,N,2425,2430,57524,203127,true,Spring Gold
|
|
497
495
|
Crocosmia ×crocosmiiflora,montbretia,X,77150,2431,181465,389870,true
|
498
496
|
Croton californicus,,N,21120,2434,76484,15234,true,California Croton
|
499
497
|
Croton setiger,turkey mullein,N,21159,13184,154156,16346,,Turkey Mullein
|
500
|
-
Crypsis schoenoides,swamp grass,X,21182,2439,773038,138716,true
|
501
|
-
Crypsis vaginiflora,,X,21183,2440,773022,138720,true
|
502
498
|
Cryptantha clevelandii var. florosa,,N,57120,11565,1045003,203153,,Coastal Cryptantha
|
503
499
|
Cryptantha corollata,,N,21213,2452,58853,203157,,Coast Range Cryptantha
|
504
500
|
Cryptantha flaccida,,N,21228,2460,56989,203167,,Flaccid Cryptantha
|
505
|
-
Cryptantha hooveri,,N,21240,2468,57701,245944,,Hoover's Cryptantha,,,,,525,1A,,,SH,GH
|
506
501
|
Cryptantha hispidula,Napa cryptantha,N,21237,2465,57703,203175,,Napa Cryptantha,annual,white,3,5
|
502
|
+
Cryptantha hooveri,,N,21240,2468,57701,245944,,Hoover's Cryptantha,,,,,525,1A,,,SH,GH
|
507
503
|
Cryptantha intermedia var. intermedia,,N,71933,11568,80627,203183
|
508
504
|
Cryptantha juniperensis,rigid cryptantha,N,103476,14557,769572,203205
|
509
505
|
Cryptantha micromeres,,N,21263,2476,770232,203194,,Minute-flowered Cryptantha
|
@@ -542,7 +538,7 @@ Dactylis glomerata,orchard grass,X,22210,2603,52720,138886,true
|
|
542
538
|
Danthonia californica,California oatgrass,N,22319,2610,57165,138931,true,California Oatgrass
|
543
539
|
Datisca glomerata,durango root,N,22377,2618,58888,16996,true,Durango Root,perennial,yellow,5,7
|
544
540
|
Datura stramonium,jimson weed,X,22387,2621,55854,67400
|
545
|
-
Datura wrightii
|
541
|
+
Datura wrightii,"sacred datura,angel's trumpet",U,22389,2622,58331,67403,,Sacred Datura,"annual,perennial",white,4,10
|
546
542
|
Daucus carota,Queen Anne's lace,X,22394,2623,76610,203298
|
547
543
|
Daucus pusillus,,N,22395,2624,56726,203299,,Rattlesnake Weed
|
548
544
|
Deinandra bacigalupii,Livermore moonshine,N,77607,9090,58817,203307,true,Livermore Tarplant,,,,,1890,1B.1,CE,,S1,G1
|
@@ -566,6 +562,7 @@ Delphinium patens subsp. patens,spreading larkspur,N,50113,2670,57246,42150,true
|
|
566
562
|
Delphinium recurvatum,valley larkspur,N,22516,2673,58305,17087,true,Byron Larkspur,perennial,,,,222,1B.2,,,S2,G2?
|
567
563
|
Delphinium variegatum subsp. variegatum,royal larkspur,N,50119,2682,50633,42157,true,Royal Larkspur,perennial,"blue,purple",3,5
|
568
564
|
Dendromecon rigida,bush poppy,N,22541,2686,58224,17131,true,Bush Poppy
|
565
|
+
Deschampsia bolanderi,,N,108404,7420,1586235,397233,Scribneria bolanderi
|
569
566
|
Deschampsia cespitosa subsp. cespitosa,tufted hairgrass,N,50130,2689,61199,167041,true,Tufted Hair Grass
|
570
567
|
Deschampsia cespitosa subsp. holciformis,tufted hairgrass,N,50133,2690,61833,167045,true,California Hairgrass
|
571
568
|
Deschampsia danthonioides,annual hairgrass,N,22598,2691,57164,139100,true,Annual Hair Grass
|
@@ -574,7 +571,7 @@ Descurainia pinnata subsp. brachycarpa,tansy mustard,N,50146,11596,59235,203355,
|
|
574
571
|
Desmazeria rigida,,X,22633,2706,288259,139152,true
|
575
572
|
Dianthus nudiflorus,,X,85151,14658,1143003,416921,Velezia rigida,,annual,pink
|
576
573
|
Dicentra formosa,bleeding heart,N,22766,2711,51048,17318,true,Bleeding Heart
|
577
|
-
Dichelostemma congestum,ookow,N,22850,2721,56593,203363,true,Ookow
|
574
|
+
Dichelostemma congestum,ookow,N,22850,2721,56593,203363,true,Ookow,corm,purple,4,6
|
578
575
|
Dichelostemma multiflorum,,N,22853,2723,62262,202526,true,Wild Hyacinth
|
579
576
|
Dichelostemma volubile,twining brodiaea,N,22855,2725,59971,203365,true,Twining Snakelily
|
580
577
|
Dichondra donelliana,California ponysfoot,N,22863,2726,61175,67501,,Dichondra
|
@@ -589,7 +586,7 @@ Diplacus kelloggii,,N,99058,13472,771826,203395,true
|
|
589
586
|
Diplacus rattanii,Rattan monkeyflower,N,99072,13479,771830,203405,true
|
590
587
|
Diplacus tricolor,,N,99079,13482,771835,203410,true
|
591
588
|
Dipsacus sativus,teasel,X,23137,2738,53028,203416
|
592
|
-
Dipterostemon capitatus,blue dicks,N,
|
589
|
+
Dipterostemon capitatus subsp. capitatus,blue dicks,N,108595,13629,1196824,375261,,,corm,"blue,white",2,6
|
593
590
|
Dirca occidentalis,western leatherwood,N,23143,2739,50315,17368,true,Western Leatherwood,,,,,567,1B.2,,,S2,G2
|
594
591
|
Distichlis spicata,saltgrass,N,23161,2743,58372,139820,true,Saltgrass
|
595
592
|
Dittrichia graveolens,stinkwort,X,2454,8482,58822,203428,true
|
@@ -613,7 +610,7 @@ Dysphania ambrosioides,Mexican tea,X,81840,10846,76746,113335,true
|
|
613
610
|
Dysphania botrys,Jerusaleum-oak,X,85274,10847,76748,113338,true
|
614
611
|
Dysphania multifida,cut leaf pigweed,X,81841,10848,76750,113343,true
|
615
612
|
Eastwoodia elegans,yellow mock aster,N,2510,2875,57967,203499,true,Yellow Mock Aster
|
616
|
-
Echinochloa colona,,X,23790,2881,
|
613
|
+
Echinochloa colona,,X,23790,2881,76755,139859,true
|
617
614
|
Echinochloa crus-galli,barnyard grass,X,23791,2882,60283,139863,true
|
618
615
|
Echinochloa muricata var. microstachya,,N,58092,9886,80690,169996,true
|
619
616
|
Echinodorus berteroi,burhead,N,23812,2886,76761,203504,true,Upright Burhead
|
@@ -639,7 +636,7 @@ Elymus condensatus,giant wild-rye,N,24165,11636,164673,140055,Leymus condensatus
|
|
639
636
|
Elymus elymoides var. elymoides,squirreltail,N,72180,11639,58377,211223,Elymus elymoides subsp. elymoides,Squirreltail
|
640
637
|
Elymus glaucus subsp. glaucus,blue wildrye,N,50264,2937,57171,167143,true,Western Rye Grass
|
641
638
|
Elymus glaucus subsp. virescens,,N,50266,2939,61203,206754,true,Blue Wildrye
|
642
|
-
Elymus hispidus,wheatgrass,X,24153,11640,155848,140096,Thinopyrum intermedium
|
639
|
+
Elymus hispidus,wheatgrass,X,24153,11640,155848,140096,Thinopyrum intermedium subsp. barbulatum
|
643
640
|
Elymus mollis subsp. mollis,,N,70142,11641,118426,206755,Leymus mollis subsp. mollis,Dune Wild Rye
|
644
641
|
Elymus multisetus,big squirreltail,N,24122,2941,57167,140134,true,Big Squirreltail
|
645
642
|
Elymus ponticus,tall wheatgrass,X,91896,11643,1301269,206756,Thinopyrum ponticum
|
@@ -705,18 +702,18 @@ Eriogonum inerme var. inerme,unarmed buckwheat,N,58586,9110,80799,130026,true,Un
|
|
705
702
|
Eriogonum lobbii,granite buckwheat,N,24839,9935,77005,114067,true,Lobb's Buckwheat,perennial,"white,pink",6,8
|
706
703
|
Eriogonum luteolum var. caninum,Tiburon buckwheat,N,58623,3297,61205,130067,true,Tiburon Buckwheat,,,,,733,1B.2,,,S2,G5T2
|
707
704
|
Eriogonum luteolum var. luteolum,,N,58624,3298,64226,130068,true,Golden-carpet Wild Buckwheat
|
708
|
-
Eriogonum nudum,naked buckwheat,N,24878,3315,53046,114099,true,Nude Buckwheat,perennial
|
709
705
|
Eriogonum nudum var. auriculatum,eared buckwheat,N,58650,3316,57220,130102,true,Nude Buckwheat
|
710
706
|
Eriogonum nudum var. pauciflorum,,N,58658,3324,57225,130111,true,Little-flower Wild Buckwheat
|
711
707
|
Eriogonum nudum var. psychicola,Antioch Dunes buckwheat,N,80051,11183,80823,130112,,Antioch Dunes Buckwheat,,,,,3401,1B.1,,,S1,G5T1
|
712
708
|
Eriogonum nudum var. pubiflorum,,N,58659,3325,57221,130113,true,Fremont's Wild Buckwheat
|
709
|
+
Eriogonum nudum,naked buckwheat,N,24878,3315,53046,114099,true,Nude Buckwheat,perennial
|
713
710
|
Eriogonum ovalifolium var. nivale,Sierran cushion wild buckwheat,N,58678,3338,80833,130136,true,Cushion Buckwheat,perennial,"white,pink,red",6,9
|
714
711
|
Eriogonum roseum,virgate buckwheat,N,24922,3360,58280,114148,true,Wand Buckwheat
|
715
712
|
Eriogonum truncatum,Mt. Diablo buckwheat,N,24957,3383,77039,114203,true,Mount Diablo Buckwheat,,,,,766,1B.1,,,S1,G1
|
716
|
-
Eriogonum umbellatum,sulfur buckwheat,N,24960,3385,77040,114207,true,Sulphur Buckwheat,perennial,yellow
|
717
713
|
Eriogonum umbellatum var. bahiiforme,sulfur flower,N,58755,3388,80851,130219,true,Sulphur Flower Buckwheat,,,,,1338,4.2,,,S3,G5T3
|
718
|
-
Eriogonum
|
714
|
+
Eriogonum umbellatum,sulfur buckwheat,N,24960,3385,77040,114207,true,Sulphur Buckwheat,perennial,yellow
|
719
715
|
Eriogonum wrightii var. subscaposum,short-stemmed bastard-sage,N,58800,3412,58985,130280,true,Wright's Buckwheat,perennial,"white,pink",6,9
|
716
|
+
Eriogonum wrightii var. trachygonum,,N,58801,3413,59244,130281,true,Wright's Buckwheat
|
720
717
|
Eriophyllum confertiflorum var. confertiflorum,golden-yarrow,N,69866,3423,53397,203738,true,Yellow Yarrow,perennial,yellow,4,8
|
721
718
|
Eriophyllum jepsonii,Jepson's woolly-sunflower,N,2816,3426,77048,203742,true,Jepson's Woolly Sunflower,,,,,776,4.3,,,S3,G3
|
722
719
|
Eriophyllum lanatum var. achilleoides,,N,7369,10587,80880,260847,true,Common Woollysunflower
|
@@ -736,7 +733,7 @@ Eryngium jepsonii,,N,78144,11674,77062,264168,,Jepson's Eryngo,,,,,3927,1B.2,,,S
|
|
736
733
|
Eryngium racemosum,Delta button-celery,N,25097,3467,77066,206800,,Delta Button-celery,,,,,787,1B.1,CE,,S1,G1
|
737
734
|
Eryngium spinosepalum,,N,25099,3468,57894,203769,,Spiny-sepaled Button-celery,,,,,788,1B.2,,,S2,G2
|
738
735
|
Eryngium vaseyi var. vallicola,,N,58851,11675,80888,211709
|
739
|
-
Erysimum capitatum var. angustatum,Contra Costa wallflower,N,58866,9942,119564,
|
736
|
+
Erysimum capitatum var. angustatum,Contra Costa wallflower,N,58866,9942,119564,47093,,,,,,,790,1B.1,CE,FE,S1,G5T1
|
740
737
|
Erysimum capitatum var. capitatum,western wallflower,N,58866,9943,50627,47096,true,Sanddune Wallflower,,"orange,yellow",3,9
|
741
738
|
Erythranthe androsacea,,N,99088,13487,771845,203774,true
|
742
739
|
Erythranthe arvensis,"villous-bracted monkeyflower,field monkeyflower",N,99091,13552,771848,206807,true,,,yellow,4,7
|
@@ -786,7 +783,7 @@ Festuca elmeri,Elmer fescue,N,25798,3580,64333,141011,true,Elmer Fescue
|
|
786
783
|
Festuca idahoensis,Idaho fescue,N,25808,3581,61200,141076,true,Idaho Fescue
|
787
784
|
Festuca microstachys,,N,25865,11688,77138,141123,Vulpia microstachys var. ciliata,Pacific Fescue
|
788
785
|
Festuca myuros,zorro grass,X,25869,11689,77140,141133,Vulpia myuros
|
789
|
-
Festuca octoflora,six-week's fescue,N,25872,11690,77141,141148,Vulpia octoflora,Six Weeks Fescue
|
786
|
+
Festuca octoflora,six-week's fescue,N,25872,11690,77141,141148,Vulpia octoflora var. hirtella,Six Weeks Fescue
|
790
787
|
Festuca perennis,Italian ryegrass,X,91964,11691,52801,203852,Lolium multiflorum
|
791
788
|
Festuca rubra,red fescue,N,25825,3586,61061,141223,true,Red Fescue
|
792
789
|
Festuca temulenta,darnel,X,93753,11692,164712,203853,Lolium temulentum
|
@@ -949,6 +946,7 @@ Isoetes howellii,Howell's quillwort,N,29392,4379,63823,199150,,Howell's Quillwor
|
|
949
946
|
Isolepis carinata,,N,80405,9608,77515,104671,true,Keeled Bulrush
|
950
947
|
Isolepis cernua,,N,79218,9605,60257,104672,true,Annual Tule
|
951
948
|
Iva axillaris,poverty weed,N,3654,10020,58837,204449,true,Poverty Weed
|
949
|
+
Jacobaea vulgaris subsp. vulgaris,tansy ragwort,X,82779,7508,487101,205893,Senecio jacobaea
|
952
950
|
Jaumea carnosa,,N,3667,4424,60969,204476,true,Fleshy Jaumea
|
953
951
|
Juglans californica,Southern California black walnut,N,29566,4428,54503,23676,true,Southern California Black Walnut,,,,,1704,4.2,,,S4,G4
|
954
952
|
Juglans hindsii,Northern California black walnut,N,29568,8943,54502,23680,true,Northern California Black Walnut,perennial,,4,5
|
@@ -1143,11 +1141,11 @@ Madia exigua,threadstem madia,N,4045,5289,56971,204827,true,Meager Tarweed
|
|
1143
1141
|
Madia gracilis,slender tarweed,N,4047,5291,53135,204829,true,Gumweed,,yellow
|
1144
1142
|
Madia radiata,showy madia,N,4053,5296,77924,204832,true,Showy Golden Madia,,,,,1054,1B.1,,,S3,G3
|
1145
1143
|
Madia sativa,coast tarweed,N,4055,5298,53143,204833,true,Coast Tarweed,,yellow
|
1146
|
-
Maianthemum racemosum,false Solomon's seal,N,
|
1144
|
+
Maianthemum racemosum subsp. amplexicaule,false Solomon's seal,N,51514,10096,53012,207757,true
|
1147
1145
|
Maianthemum stellatum,,N,32497,9629,53268,204838,true,False Solomon Seal
|
1148
1146
|
Malacothamnus arcuatus var. elmeri,,N,108345,14681,1497404,412621,,Eastern Bewildering Bushmallow,perennial,pink,4,5,1065,1B.2,,,S2,G2
|
1149
1147
|
Malacothamnus fremontii var. fremontii,long-haired unfurled bushmallow,N,108341,14689,70398,400947,Malacothamnus fremontii,,perennial,pink,5,6
|
1150
|
-
Malacothamnus hallii,Hall's bushmallow,N,108345,
|
1148
|
+
Malacothamnus hallii,Hall's bushmallow,N,108345,5314,1497404,25364,,,perennial,pink,4,5,1065,1B.2,,,S2,G2
|
1151
1149
|
Malacothrix californica,,N,4059,5325,58026,204841,true,California Desertdandelion
|
1152
1150
|
Malacothrix clevelandii,Cleveland's malacothrix,N,4060,5326,58841,204842,true,Cleveland's Desertdandelion
|
1153
1151
|
Malacothrix coulteri,snake's-head,N,4061,5327,58027,204843,true,Snake's Head
|
@@ -1272,7 +1270,7 @@ Nicotiana glauca,tree tobacco,X,34646,5860,58334,72870
|
|
1272
1270
|
Nicotiana quadrivalvis,Indian tobacco,N,34649,5862,58336,72878,,Indian Tobacco
|
1273
1271
|
Nitrophila occidentalis,borax weed,N,34675,5865,78223,116737,true,Boraxweed
|
1274
1272
|
Nothoscordum gracile,false garlic,X,34732,10157,78233,205139,true
|
1275
|
-
Nuttallanthus texanus,blue toadflax,N,34756,11883,
|
1273
|
+
Nuttallanthus texanus,blue toadflax,N,34756,11883,209238,72929,true,Blue Toadflax
|
1276
1274
|
Oemleria cerasiformis,oso berrry,N,34900,5879,53419,26643,true,Osoberry
|
1277
1275
|
Oenanthe sarmentosa,,N,34904,5881,60127,205153,,Pacific Oenanthe
|
1278
1276
|
Oenothera biennis,common evening-primrose,X,34975,5882,62207,26661,true
|
@@ -1334,7 +1332,6 @@ Persicaria maculosa,lady's thumb,X,82466,11011,56166,117853,true
|
|
1334
1332
|
Persicaria punctata,,N,37303,11014,78456,117874,true,Water Smartweed
|
1335
1333
|
Petasites frigidus var. palmatus,coltsfoot,N,8060,6269,55778,205301,true,Arctic Sweet Coltsfoot
|
1336
1334
|
Petrorhagia dubia,pink grass,X,37370,6275,60602,117891,true
|
1337
|
-
Petunia parviflora,wild petunia,N,37378,6279,159650,74142,,Seaside Petunia
|
1338
1335
|
Phacelia breweri,Brewer's phacelia,N,37425,6292,68813,205312,,Brewer's Phacelia,annual,blue,3,6
|
1339
1336
|
Phacelia californica,rock phacelia,N,37426,6293,53170,205313,,Rock Phacelia,perennial,blue,3,9
|
1340
1337
|
Phacelia ciliata,great valley phacelia,N,37432,6302,58180,205324,,Great Valley Phacelia,annual,blue,3,6
|
@@ -1413,7 +1410,7 @@ Plantago subnuda,naked plantain,N,38605,6626,60223,74567,true,Naked Plantain
|
|
1413
1410
|
Platanthera dilatata var. leucostachys,white-flowered bog orchid,N,63974,9593,81271,205521,true,White Bog Orchid
|
1414
1411
|
Platanus racemosa,western sycamore,N,38655,6633,58231,28255,true,Western Sycamore,perennial,red,2,4
|
1415
1412
|
Platystemon californicus,cream cups,N,38664,6635,51288,28269,true,Creamcups
|
1416
|
-
Plectritis ciliosa,,N,38677,6639,57284,
|
1413
|
+
Plectritis ciliosa,,N,38677,6639,57284,205528,,Longspur Seablush,,pink,3,6
|
1417
1414
|
Plectritis congesta subsp. brachystemon,,N,52336,11937,57787,205537,,Small-flowered Plectritis
|
1418
1415
|
Plectritis congesta subsp. congesta,,N,52337,11938,59253,205535,,Sea Blush
|
1419
1416
|
Plectritis macrocera,,N,38684,6643,57287,205540,,Longhorn Seablush,,white,3,6
|
@@ -1529,10 +1526,13 @@ Ranunculus occidentalis var. occidentalis,,N,64947,11979,81335,50940,true,Wester
|
|
1529
1526
|
Ranunculus orthorhynchus var. bloomeri,,N,64956,7051,81337,50948,true,Bloomer's Buttercup
|
1530
1527
|
Ranunculus orthorhynchus var. orthorhynchus,,N,64957,7052,81338,50950,true,Straightbeak Buttercup
|
1531
1528
|
Ranunculus repens,,X,40965,7056,48229,29669,true
|
1532
|
-
Ranunculus sceleratus,cursed crowsfoot,N,40971,7059,59301,29675,true,Cursed Buttercup
|
1533
1529
|
Ranunculus sceleratus var. sceleratus,,X,64987,11983,81341,50983,true,,annual,yellow,4,6
|
1530
|
+
Ranunculus sceleratus,cursed crowsfoot,N,40971,7059,59301,29675,true,Cursed Buttercup
|
1534
1531
|
Raphanus raphanistrum,jointed charlock,X,40991,7063,55411,29701,true
|
1535
1532
|
Raphanus sativus,wild radish,X,40992,7064,995125,29702,true
|
1533
|
+
Ravenella exigua,chaparral harebell,N,84837,14672,1342787,412341,,,,,,,265,1B.2,,,S2,G2
|
1534
|
+
Ravenella griffinii,,N,84836,14796,1342789,412342
|
1535
|
+
Ravenella sharsmithiae,,N,108392,14673,1342786,208086,,,,,,,267,1B.2,,,S1S2,G1G2
|
1536
1536
|
Rhamnus alaternus,Italian buckthorn,X,81104,9447,82856,29726,true
|
1537
1537
|
Rhamnus crocea,spiny redberry,N,41069,7075,57243,29736,true,Spiny Redberry
|
1538
1538
|
Rhamnus ilicifolia,holly-leaf redberry,N,41070,7076,58308,29743,true,Hollyleaf Redberry
|
@@ -1544,8 +1544,8 @@ Ribes aureum var. gracillimum,golden currant,N,65126,7104,55547,51084,true,Golde
|
|
1544
1544
|
Ribes californicum var. californicum,hillside gooseberry,N,65128,7108,47128,51086,true,Hillside Gooseberry,perennial,white,2,3
|
1545
1545
|
Ribes divaricatum var. pubiflorum,straggly gooseberry,N,65143,7117,53434,51104,true,Straggly Gooseberry,perennial,white,3,5
|
1546
1546
|
Ribes malvaceum var. malvaceum,pink-flowering currant,N,65160,7128,54947,51119,Ribes malvaceum,Chaparral Currant,perennial,pink,10,4
|
1547
|
-
Ribes menziesii,canyon gooseberry,N,41423,7131,52687,29958,true,Canyon Gooseberry
|
1548
1547
|
Ribes menziesii var. menziesii,canyon gooseberry,N,65168,10307,53114,51126,Ribes menziesii,Canyon Gooseberry,perennial,white,2,4
|
1548
|
+
Ribes menziesii,canyon gooseberry,N,41423,7131,52687,29958,true,Canyon Gooseberry
|
1549
1549
|
Ribes quercetorum,oak gooseberry,N,41449,7136,55548,29981,true,Rock Gooseberry,perennial,yellow,3,5
|
1550
1550
|
Ribes sanguineum var. glutinosum,red-flowering currant,N,65190,7142,53436,51152,true,Pink-flowering Currant,perennial,pink,2,4
|
1551
1551
|
Ribes speciosum,fuchsia-flowered gooseberry,N,41466,7145,50824,29994,true,Fuchsiaflower Gooseberry,perennial,red,1,5
|
@@ -1637,7 +1637,6 @@ Schoenoplectus tabernaemontani,,N,80321,9611,78998,105209,true,Tule
|
|
1637
1637
|
Scirpus microcarpus,,N,43718,7398,59068,105310,true,Panicled Bulrush
|
1638
1638
|
Scoliopus bigelovii,,N,43824,7416,48990,205840,true,Fetid Adderstongue
|
1639
1639
|
Scolymus hispanicus,golden thistle,X,4661,7417,79009,207280,true
|
1640
|
-
Scribneria bolanderi,,N,43846,7420,1586235,148492,true,Scribner's Grass
|
1641
1640
|
Scrophularia californica,California figwort,N,43849,7422,50812,75853,true,Bee Plant,,white
|
1642
1641
|
Scutellaria bolanderi subsp. bolanderi,Sierra skullcap,N,52896,7431,80184,96443,,Sierra Skullcap,perennial,"white,blue",6,7
|
1643
1642
|
Scutellaria californica,,N,43883,7432,59791,75893,,California Skullcap,perennial
|
@@ -1651,12 +1650,11 @@ Sedum radiatum subsp. radiatum,,N,52943,14601,238486,43756,Sedum radiatum var. r
|
|
1651
1650
|
Sedum radiatum,coast range stonecrop,N,44006,7457,61471,31890,true,Coast Range Stonecrop
|
1652
1651
|
Sedum spathulifolium,broadleaf stonecrop,N,44016,7459,58886,31905,true,Yellow Stonecrop
|
1653
1652
|
Selaginella bigelovii,spike-moss,N,44043,7462,58768,199857,true,Spike Moss
|
1654
|
-
Senecio aphanactis,chaparral ragwort,N,4672,7473,63375,205846,true,Chaparral Ragwort,,,,,1773,
|
1653
|
+
Senecio aphanactis,chaparral ragwort,N,4672,7473,63375,205846,true,Chaparral Ragwort,,,,,1773,1B.2,,,S2,G3
|
1655
1654
|
Senecio aronicoides,rayless ragwort,N,4674,7474,53206,205848,true,Rayless Ragwort
|
1656
1655
|
Senecio flaccidus var. douglasii,Douglas' ragwort,N,8218,7492,58037,205865,true,Douglas' Groundsel
|
1657
1656
|
Senecio glomeratus,cutleaf burnweed,X,2573,10688,60981,205883,Erechtites glomeratus
|
1658
1657
|
Senecio hydrophilus,water ragwort,N,4759,7501,64165,205888,true,Water Groundsel
|
1659
|
-
Senecio jacobaea,tansy ragwort,X,4770,7508,62498,205894,true
|
1660
1658
|
Senecio minimus,Australian fireweed,X,2580,11076,60980,205904,Erechtites minimus
|
1661
1659
|
Senecio sylvaticus,woodland ragwort,X,4853,7522,53210,205927,true
|
1662
1660
|
Senecio vulgaris,common groundsel,X,4866,7524,53211,205929,true,,,yellow
|
@@ -1689,9 +1687,8 @@ Solanum elaeagnifolium,white horse-nettle,X,44852,7654,79137,76470
|
|
1689
1687
|
Solanum furcatum,,X,44856,7655,79138,76521
|
1690
1688
|
Solanum lanceolatum,lanceleaf nightshade,X,44872,7656,79139,76689
|
1691
1689
|
Solanum nigrum,black nightshade,X,44883,7658,79141,76840
|
1692
|
-
Solanum
|
1690
|
+
Solanum nitidibaccatum,nightshade,N,103838,11086,406080,211825,,,annual,white,5,10
|
1693
1691
|
Solanum umbelliferum,blue witch,N,44919,7664,50639,77221,,Bluewitch Nightshade
|
1694
|
-
Solanum xanti,,N,77308,7666,79146,77288,,Purple Nightshade
|
1695
1692
|
Soleirolia soleirolii,baby's tears,X,44928,7667,79147,32304,true
|
1696
1693
|
Solidago elongata,Canada goldenrod,N,4956,12025,79150,206005,true,Canadian Goldenrod
|
1697
1694
|
Solidago velutina subsp. californica,California goldenrod,N,85830,11088,80217,205992,true,California Goldenrod
|
@@ -1703,10 +1700,6 @@ Sorghum bicolor,sorghum,X,45003,7690,58389,148856,true
|
|
1703
1700
|
Sorghum halepense,Johnson-grass,X,45017,7691,58387,148887,true
|
1704
1701
|
Sparganium eurycarpum var. eurycarpum,bur-reed,N,73845,12031,63347,207940,Sparganium eurycarpum,Bur Reed
|
1705
1702
|
Sparganium eurycarpum var. greenei,,N,66594,12032,842663,174978,,Simplestem Bur Reed
|
1706
|
-
Spartina alterniflora,saltwater cordgrass,X,45038,7699,772903,148951,true
|
1707
|
-
Spartina densiflora,dense-flowered cordgrass,X,45043,7700,772990,148961,true
|
1708
|
-
Spartina foliosa,California cordgrass,N,45044,7701,772992,148963,true,California Cord Grass
|
1709
|
-
Spartina patens,saltmeadow cordgrass,X,45048,7703,773004,148979,true
|
1710
1703
|
Spartium junceum,Spanish broom,X,45053,7704,47406,32391
|
1711
1704
|
Spergula arvensis,spurrey,X,45074,9630,57005,119398,true
|
1712
1705
|
Spergularia bocconi,,X,45079,10693,594639,119404,true
|
@@ -1720,7 +1713,13 @@ Spergularia villosa,hairy sand-spurrey,X,45096,7717,60173,119423,true
|
|
1720
1713
|
Spiranthes porrifolia,,N,45262,7740,50742,206062,true,Creamy Lady's Tresses
|
1721
1714
|
Spiranthes romanzoffiana,,N,45264,7741,50743,206063,true,Irish Lady's-tresses
|
1722
1715
|
Sporobolus airoides,alkali sacaton,N,45286,7744,60313,149026,true,Alkali Sacaton
|
1716
|
+
Sporobolus alterniflorus,saltwater cordgrass,X,82872,7699,772903,148951,Spartina alterniflora
|
1717
|
+
Sporobolus densiflorus,dense-flowered cordgrass,X,108405,7700,169300,148961,Spartina densiflora
|
1718
|
+
Sporobolus foliosus,California cordgrass,N,82873,7701,772992,208714,Spartina foliosa
|
1723
1719
|
Sporobolus indicus,smutgrass,X,45308,7749,79187,149101,true
|
1720
|
+
Sporobolus niliacus,,X,82876,2440,773022,397065,Crypsis vaginiflora
|
1721
|
+
Sporobolus pumilus,saltmeadow cordgrass,X,82878,7703,773004,148979,Spartina patens
|
1722
|
+
Sporobolus schoenoides,swamp grass,X,82879,2439,773038,397066,Crypsis schoenoides
|
1724
1723
|
Stachys ajugoides,hedge nettle,N,45338,7751,53295,77371,,Ajuga Hedge Nettle
|
1725
1724
|
Stachys albens,,N,45339,7754,58192,77372,,White Hedge Nettle
|
1726
1725
|
Stachys bullata,,N,45343,7756,58930,77383,,California Hedgenettle
|
@@ -1738,9 +1737,9 @@ Stephanomeria virgata subsp. pleurocarpa,,N,6227,7806,58849,206092,true,Wand Wir
|
|
1738
1737
|
Stipa cernua,nodding needlegrass,N,45640,12042,165654,149288,Nassella cernua,Nodding Needle Grass
|
1739
1738
|
Stipa lemmonii var. lemmonii,Lemmon's needlegrass,N,73899,12053,1220756,173006,Achnatherum lemmonii subsp. lemmonii
|
1740
1739
|
Stipa lepida,foothill needlegrass,N,45641,12054,165656,149399,Nassella lepida,Foothill Needlegrass
|
1741
|
-
Stipa miliacea var. miliacea,smilo grass,X,91920,12058,524183,206097,Piptatherum miliaceum
|
1740
|
+
Stipa miliacea var. miliacea,smilo grass,X,91920,12058,524183,206097,Piptatherum miliaceum subsp. miliaceum
|
1742
1741
|
Stipa pulchra,purple needlegrass,N,45644,12067,165659,149498,Nassella pulchra,Purple Needlegrass
|
1743
|
-
Streptanthus albidus subsp. peramoenus,most beautiful jewelflower,N,53142,7814,58783,
|
1742
|
+
Streptanthus albidus subsp. peramoenus,most beautiful jewelflower,N,53142,7814,58783,258754,Streptanthus glandulosus subsp. glandulosus,,,,,,1490,1B.2,,,S2,G2T2
|
1744
1743
|
Streptanthus breweri,,N,45725,7822,79258,32606,true,Brewer's Jewelflower
|
1745
1744
|
Streptanthus glandulosus subsp. glandulosus,jewelflower,N,53142,7837,58783,43881,true,Most Beautiful Jewel Flower
|
1746
1745
|
Streptanthus hispidus,Mt. Diablo jewelflower,N,45741,7842,50620,32624,true,Mount Diablo Jewelflower,,,,,1502,1B.3,,,S2,G2
|
@@ -1826,7 +1825,7 @@ Triglochin maritima,seaside arrow-grass,N,47197,8114,60264,206250,true,Arrowgras
|
|
1826
1825
|
Triglochin scilloides,flowering quillwort,N,91083,12117,79437,204660,Lilaea scilloides,Flowering-quillwort
|
1827
1826
|
Triglochin striata,,N,47201,8116,79438,206252,true,Three-ribbed Arrow-grass
|
1828
1827
|
Trillium chloropetalum,giant trillium,N,47218,8119,50823,206256,true,Giant Wakerobin,,"yellow,pink,purple,white",4,5
|
1829
|
-
Trillium ovatum
|
1828
|
+
Trillium ovatum,white trillium,N,47239,8120,49463,206258,true,Western Trillium
|
1830
1829
|
Triodanis biflora,Venus' looking-glass,N,47267,8126,79440,206266,,Small Venus' Looking-glass
|
1831
1830
|
Triphysaria eriantha subsp. eriantha,butter-and-eggs,N,53279,8129,59332,96567,true,Butter'n Eggs
|
1832
1831
|
Triphysaria pusilla,,N,47296,8133,57276,78297,true,Dwarf Owl's-clover
|
@@ -1839,15 +1838,15 @@ Tropaeolum majus,garden nasturtium,X,47408,8167,54329,34321,true
|
|
1839
1838
|
Tropidocarpum capparideum,caper-fruited tropidocarpum,N,47411,8168,79456,34327,true,Caper-fruited Tropidocarpum,annual,yellow,3,4,1255,1B.1,,,S1,G1
|
1840
1839
|
Tropidocarpum gracile,dobie pod,N,47412,8169,58091,34328,true,Dobie Pod,annual,yellow,3,5
|
1841
1840
|
Turritis glabra,tower mustard,N,47457,12119,79460,34347,true,Tower Mustard
|
1842
|
-
Typha angustifolia,narrow-leaved cattail,U,47462,8176,60316,174863,true
|
1841
|
+
Typha angustifolia,narrow-leaved cattail,U,47462,8176,60316,174863,true,Narrowleaf Cattail
|
1843
1842
|
Typha domingensis,southern cattail,N,47463,8177,58392,174864,true,Southern Cattail
|
1844
1843
|
Typha latifolia,cattail,N,47466,8178,48685,174865,true,Broadleaf Cattail
|
1845
1844
|
Ulmus minor,English elm,X,47478,8180,79461,34372,Ulmus procera
|
1846
1845
|
Umbellularia californica,California bay,N,47489,8183,48807,34384,true,California Laurel,perennial,yellow,11,5
|
1847
1846
|
Uropappus lindleyi,silver puffs,N,76212,8184,50806,206299,true,Uropappus
|
1848
1847
|
Urospermum picroides,false hawkbit,X,5477,8185,59361,206301,true
|
1849
|
-
Urtica
|
1850
|
-
Urtica
|
1848
|
+
Urtica gracilis subsp. gracilis,American stinging nettle,N,70675,8186,1074432,207397,Urtica dioica subsp. gracilis
|
1849
|
+
Urtica gracilis subsp. holosericea,hoary nettle,N,53304,8187,141851,44056,Urtica dioica subsp. holosericea
|
1851
1850
|
Urtica urens,dwarf nettle,X,47589,8188,53315,34426,true
|
1852
1851
|
Vaccinium ovatum,"California huckleberry,evergreen huckleberry",N,47685,8200,48349,78452,true,Evergreen Huckleberry
|
1853
1852
|
Vancouveria planipetala,inside-out flower,N,47786,8215,63938,34467,true,Insideout Flower
|
@@ -0,0 +1 @@
|
|
1
|
+
3 [stamens](./g/stamen.html). Crown surrounding [anthers](./g/anther.html).
|
@@ -0,0 +1 @@
|
|
1
|
+
6 [stamens](./g/stamen.html) (2 different sizes).
|
package/lib/taxonomy/taxon.js
CHANGED
package/lib/tools/cch2.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import path from "node:path";
|
2
|
+
import { renameSync } from "node:fs";
|
3
|
+
import puppeteer from "puppeteer";
|
2
4
|
import { CSV } from "../csv.js";
|
3
5
|
import { TaxaCSV } from "./taxacsv.js";
|
4
6
|
import { Files } from "../files.js";
|
5
|
-
import puppeteer from "puppeteer";
|
6
|
-
import { renameSync } from "node:fs";
|
7
7
|
|
8
8
|
/**
|
9
9
|
* @typedef {{id:string}} CCHTaxon
|
@@ -29,12 +29,12 @@ export class CCH2 {
|
|
29
29
|
) {
|
30
30
|
const toolsDataPath = path.join(toolsDataDir, "cch2");
|
31
31
|
|
32
|
-
const cchTaxa = await getCCHTaxa(toolsDataPath
|
32
|
+
const cchTaxa = await getCCHTaxa(toolsDataPath);
|
33
33
|
|
34
34
|
const idsToUpdate = new Map();
|
35
35
|
for (const taxon of taxa.getTaxonList()) {
|
36
36
|
const name = taxon.getName();
|
37
|
-
const cchTaxon = cchTaxa
|
37
|
+
const cchTaxon = getCCHTaxon(taxon, cchTaxa);
|
38
38
|
if (!cchTaxon) {
|
39
39
|
if (!exceptions.hasException(name, "cch", "notincch")) {
|
40
40
|
errorLog.log(name, "not found in CCH data");
|
@@ -106,27 +106,18 @@ export class CCH2 {
|
|
106
106
|
|
107
107
|
/**
|
108
108
|
* @param {string} toolsDataPath
|
109
|
-
* @param {import("../types.js").Taxa} taxa
|
110
109
|
* @returns {Promise<CCHTaxa>}
|
111
110
|
*/
|
112
|
-
async function getCCHTaxa(toolsDataPath
|
111
|
+
async function getCCHTaxa(toolsDataPath) {
|
113
112
|
/**
|
114
|
-
* @param {{taxonID:string,scientificName:string,rankID:string,acceptance:"0"|"1",acceptedTaxonID:string}} record
|
113
|
+
* @param {{taxonID:string,scientificName:string,rankID:string,acceptance:"0"|"1",acceptedTaxonID:string,acceptedScientificName:string}} record
|
115
114
|
*/
|
116
115
|
function callback(record) {
|
117
116
|
if (parseInt(record.rankID) < 220) {
|
118
117
|
// Ignore ranks above species.
|
119
118
|
return;
|
120
119
|
}
|
121
|
-
|
122
|
-
// If we're not tracking the taxon, ignore it.
|
123
|
-
return;
|
124
|
-
}
|
125
|
-
if (record.acceptance !== "1" && data.has(record.scientificName)) {
|
126
|
-
// Only add the synonym if there is no main entry.
|
127
|
-
return;
|
128
|
-
}
|
129
|
-
data.set(record.scientificName, { id: record.acceptedTaxonID });
|
120
|
+
cchTaxa.set(record.scientificName, { id: record.taxonID });
|
130
121
|
}
|
131
122
|
|
132
123
|
const fileName = path.join(toolsDataPath, "taxa.csv");
|
@@ -134,11 +125,39 @@ async function getCCHTaxa(toolsDataPath, taxa) {
|
|
134
125
|
await retrieveDataFile(toolsDataPath);
|
135
126
|
}
|
136
127
|
|
137
|
-
const
|
128
|
+
const cchTaxa = new Map();
|
138
129
|
|
139
130
|
await CSV.parseFileStream(fileName, callback);
|
140
131
|
|
141
|
-
return
|
132
|
+
return cchTaxa;
|
133
|
+
}
|
134
|
+
|
135
|
+
/**
|
136
|
+
* @param {import("../types.js").Taxon} taxon
|
137
|
+
* @param {CCHTaxa} cchTaxa
|
138
|
+
* @returns {CCHTaxon|undefined}
|
139
|
+
*/
|
140
|
+
function getCCHTaxon(taxon, cchTaxa) {
|
141
|
+
/**
|
142
|
+
* @param {string} name
|
143
|
+
*/
|
144
|
+
function getTaxon(name) {
|
145
|
+
return cchTaxa.get(name);
|
146
|
+
}
|
147
|
+
|
148
|
+
const name = taxon.getName();
|
149
|
+
const cchTaxon = getTaxon(name);
|
150
|
+
if (cchTaxon) {
|
151
|
+
return cchTaxon;
|
152
|
+
}
|
153
|
+
|
154
|
+
// No reference for the current name; try synonyms and see if any of them work.
|
155
|
+
for (const synonym of taxon.getSynonyms()) {
|
156
|
+
const cchTaxon = getTaxon(synonym);
|
157
|
+
if (cchTaxon) {
|
158
|
+
return cchTaxon;
|
159
|
+
}
|
160
|
+
}
|
142
161
|
}
|
143
162
|
|
144
163
|
/**
|
@@ -8,7 +8,7 @@ export class JepsonFamilies {
|
|
8
8
|
* @param {string} outputdir
|
9
9
|
*/
|
10
10
|
static async build(toolsDataDir, outputdir) {
|
11
|
-
const url = "https://ucjeps.berkeley.edu/
|
11
|
+
const url = "https://ucjeps.berkeley.edu/IJM_keys/toc.html";
|
12
12
|
const indexFileName = path.basename(url);
|
13
13
|
const toolsDataPath = toolsDataDir + "/jepsonfam";
|
14
14
|
const indexFilePath = toolsDataPath + "/" + indexFileName;
|
package/package.json
CHANGED
package/scripts/cpl-photos.js
CHANGED
@@ -9,6 +9,7 @@ import { existsSync } from "fs";
|
|
9
9
|
import { CSV } from "../lib/csv.js";
|
10
10
|
|
11
11
|
const PHOTO_FILE_NAME = "inattaxonphotos.csv";
|
12
|
+
const PHOTO_FILE_PATH = `./data/${PHOTO_FILE_NAME}`;
|
12
13
|
|
13
14
|
const OPT_LOADER = "loader";
|
14
15
|
|
@@ -58,27 +59,7 @@ async function addMissingPhotos(options) {
|
|
58
59
|
errorLog.write();
|
59
60
|
|
60
61
|
// Write updated photo file.
|
61
|
-
|
62
|
-
/** @type {string[][]} */
|
63
|
-
const data = [];
|
64
|
-
for (const taxonName of [...currentTaxaPhotos.keys()].sort()) {
|
65
|
-
// @ts-ignore
|
66
|
-
for (const photo of currentTaxaPhotos.get(taxonName)) {
|
67
|
-
data.push([
|
68
|
-
taxonName,
|
69
|
-
photo.id,
|
70
|
-
photo.ext,
|
71
|
-
photo.licenseCode,
|
72
|
-
photo.attrName ?? "",
|
73
|
-
]);
|
74
|
-
}
|
75
|
-
}
|
76
|
-
|
77
|
-
CSV.writeFileArray(
|
78
|
-
`${options.outputdir}/${PHOTO_FILE_NAME}`,
|
79
|
-
data,
|
80
|
-
headers,
|
81
|
-
);
|
62
|
+
writePhotos(currentTaxaPhotos);
|
82
63
|
}
|
83
64
|
|
84
65
|
/**
|
@@ -128,12 +109,39 @@ async function getTaxa(options) {
|
|
128
109
|
return taxa;
|
129
110
|
}
|
130
111
|
|
112
|
+
/**
|
113
|
+
* @param {{outputdir:string,update:boolean}} options
|
114
|
+
*/
|
115
|
+
async function prune(options) {
|
116
|
+
const taxa = await getTaxa(options);
|
117
|
+
const errorLog = new ErrorLog(options.outputdir + "/log.tsv", true);
|
118
|
+
const currentTaxaPhotos = readPhotos();
|
119
|
+
|
120
|
+
const invalidNames = new Set();
|
121
|
+
|
122
|
+
for (const name of currentTaxaPhotos.keys()) {
|
123
|
+
const taxon = taxa.getTaxon(name);
|
124
|
+
if (!taxon) {
|
125
|
+
errorLog.log(name, `is in ${PHOTO_FILE_NAME} but not in taxa list`);
|
126
|
+
invalidNames.add(name);
|
127
|
+
}
|
128
|
+
}
|
129
|
+
|
130
|
+
if (options.update) {
|
131
|
+
for (const name of invalidNames) {
|
132
|
+
currentTaxaPhotos.delete(name);
|
133
|
+
}
|
134
|
+
writePhotos(currentTaxaPhotos);
|
135
|
+
}
|
136
|
+
|
137
|
+
errorLog.write();
|
138
|
+
}
|
139
|
+
|
131
140
|
/**
|
132
141
|
* @returns {Map<string,import("../lib/utils/inat-tools.js").InatPhotoInfo[]>}
|
133
142
|
*/
|
134
143
|
function readPhotos() {
|
135
|
-
|
136
|
-
if (!existsSync(photosFileName)) {
|
144
|
+
if (!existsSync(PHOTO_FILE_PATH)) {
|
137
145
|
return new Map();
|
138
146
|
}
|
139
147
|
|
@@ -142,7 +150,7 @@ function readPhotos() {
|
|
142
150
|
|
143
151
|
/** @type {import("../lib/utils/inat-tools.js").InatCsvPhoto[]} */
|
144
152
|
// @ts-ignore
|
145
|
-
const csvPhotos = CSV.readFile(
|
153
|
+
const csvPhotos = CSV.readFile(PHOTO_FILE_PATH);
|
146
154
|
for (const csvPhoto of csvPhotos) {
|
147
155
|
const taxonName = csvPhoto.name;
|
148
156
|
let photos = taxonPhotos.get(taxonName);
|
@@ -161,6 +169,30 @@ function readPhotos() {
|
|
161
169
|
return taxonPhotos;
|
162
170
|
}
|
163
171
|
|
172
|
+
/**
|
173
|
+
* @param {Map<string,import("../lib/utils/inat-tools.js").InatPhotoInfo[]>} currentTaxaPhotos
|
174
|
+
*/
|
175
|
+
function writePhotos(currentTaxaPhotos) {
|
176
|
+
// Write updated photo file.
|
177
|
+
const headers = ["name", "id", "ext", "licenseCode", "attrName"];
|
178
|
+
/** @type {string[][]} */
|
179
|
+
const data = [];
|
180
|
+
for (const taxonName of [...currentTaxaPhotos.keys()].sort()) {
|
181
|
+
// @ts-ignore - should always be defined at this point
|
182
|
+
for (const photo of currentTaxaPhotos.get(taxonName)) {
|
183
|
+
data.push([
|
184
|
+
taxonName,
|
185
|
+
photo.id,
|
186
|
+
photo.ext,
|
187
|
+
photo.licenseCode,
|
188
|
+
photo.attrName ?? "",
|
189
|
+
]);
|
190
|
+
}
|
191
|
+
}
|
192
|
+
|
193
|
+
CSV.writeFileArray(PHOTO_FILE_PATH, data, headers);
|
194
|
+
}
|
195
|
+
|
164
196
|
const program = Program.getProgram();
|
165
197
|
program
|
166
198
|
.command("checkmissing")
|
@@ -176,9 +208,14 @@ if (process.env.npm_package_name === "@ca-plant-list/ca-plant-list") {
|
|
176
208
|
.command("addmissing")
|
177
209
|
.description("Add photos to taxa with fewer than the maximum")
|
178
210
|
.action(() => addMissingPhotos(program.opts()));
|
211
|
+
program
|
212
|
+
.command("prune")
|
213
|
+
.description("Remove photos without valid taxon names")
|
214
|
+
.action(() => prune(program.opts()));
|
179
215
|
}
|
180
216
|
program.option(
|
181
217
|
"--loader <path>",
|
182
218
|
"The path (relative to the current directory) of the JavaScript file containing the TaxaLoader class. If not provided, the default TaxaLoader will be used.",
|
183
219
|
);
|
220
|
+
program.option("--update", "Update the file if possible.");
|
184
221
|
await program.parseAsync();
|
package/scripts/cpl-tools.js
CHANGED
@@ -58,10 +58,13 @@ async function build(program, options) {
|
|
58
58
|
|
59
59
|
const exceptions = new Exceptions(options.datadir);
|
60
60
|
const config = new Config(options.datadir);
|
61
|
-
const taxa = await Taxa.loadTaxa(options);
|
62
61
|
|
63
62
|
const errorLog = new ErrorLog(options.outputdir + "/log.tsv", true);
|
64
63
|
for (const tool of tools) {
|
64
|
+
const taxa =
|
65
|
+
tool === TOOLS.JEPSON_FAM
|
66
|
+
? undefined
|
67
|
+
: await Taxa.loadTaxa(options);
|
65
68
|
switch (tool) {
|
66
69
|
case TOOLS.CALFLORA:
|
67
70
|
await Calflora.analyze(
|