@ca-plant-list/ca-plant-list 0.4.30 → 0.4.31
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/inattaxonphotos.csv +4 -11
- package/data/synonyms.csv +2 -0
- package/data/taxa.csv +6 -5
- package/lib/externalsites.js +15 -9
- package/lib/htmltaxon.js +44 -1
- package/lib/tools/inat.js +33 -4
- package/package.json +1 -1
package/data/inattaxonphotos.csv
CHANGED
@@ -53,7 +53,6 @@ Acaena californica,7285167,jpeg,cc-by-nc,Alison Young
|
|
53
53
|
Acanthomintha lanceolata,38917484,jpeg,cc-by-nc,Joey Santore
|
54
54
|
Acanthomintha lanceolata,35057066,jpeg,cc-by-nc,Damon Tighe
|
55
55
|
Acanthomintha lanceolata,37516943,jpg,cc-by,Ken-ichi Ueda
|
56
|
-
Acer campestre,304282317,jpg,cc-by-nc,Soumil
|
57
56
|
Acer campestre,21762680,jpeg,cc-by-nc,wolf3178
|
58
57
|
Acer campestre,10775,jpg,cc-by-nc,AnneTanne
|
59
58
|
Acer campestre,451583323,jpeg,cc-by-nc,Marek Koszorek
|
@@ -168,7 +167,6 @@ Agrostis pallens,390912548,jpg,cc-by-nc,jrebman
|
|
168
167
|
Agrostis stolonifera,43639048,jpg,cc-by-nc,Barbara L. Wilson
|
169
168
|
Agrostis stolonifera,65982270,jpeg,cc-by-nc,Rowan Hindmarsh-Walls
|
170
169
|
Agrostis stolonifera,42924476,jpg,cc-by-nc,arseniy maximenko
|
171
|
-
Ailanthus altissima,32905540,jpeg,cc-by-nc,Katerina Kashirina
|
172
170
|
Ailanthus altissima,74889269,jpg,cc-by,Emily Summerbell
|
173
171
|
Ailanthus altissima,124882976,jpg,cc-by,Jessica Precht
|
174
172
|
Ailanthus altissima,80889194,jpeg,cc-by-nc,Matthieu Gauvain
|
@@ -311,6 +309,8 @@ Amsinckia menziesii,62837069,jpg,cc-by-nc,jalopy
|
|
311
309
|
Amsinckia menziesii,184386626,jpeg,cc-by-nc,Peri Lee Pipkin
|
312
310
|
Amsinckia menziesii,62966680,jpeg,cc-by-nc,jalopy
|
313
311
|
Amsinckia menziesii,62463973,jpeg,cc-by-nc,devinl
|
312
|
+
Amsinckia retrorsa,23982770,jpeg,cc-by-nc,James Bailey
|
313
|
+
Amsinckia retrorsa,23982685,jpeg,cc-by-nc,James Bailey
|
314
314
|
Amsinckia tessellata var. gloriosa,189079209,jpg,cc-by-nc,davidmagney
|
315
315
|
Amsinckia tessellata var. gloriosa,265596824,jpeg,cc-by,Matt Berger
|
316
316
|
Amsinckia tessellata var. gloriosa,263526141,jpg,cc-by-nc,pleistocene
|
@@ -979,7 +979,6 @@ Cardamine californica,344581239,jpg,cc-by-nc,nathantay
|
|
979
979
|
Cardamine californica,73565,jpg,cc-by,dloarie
|
980
980
|
Cardamine californica,180021353,jpg,cc-by-nc,J. Maughn
|
981
981
|
Cardamine hirsuta,10620,jpg,cc-by-nc,AnneTanne
|
982
|
-
Cardamine hirsuta,96758889,jpg,cc-by,Kevin Thiele
|
983
982
|
Cardamine oligosperma,3002876,jpg,cc-by,Don Loarie
|
984
983
|
Cardamine oligosperma,86226,jpg,cc-by,Ken-ichi Ueda
|
985
984
|
Cardamine oligosperma,86227,jpg,cc-by,Ken-ichi Ueda
|
@@ -1673,7 +1672,6 @@ Datura wrightii,426614925,jpeg,cc-by-nc,txnaturewatch
|
|
1673
1672
|
Daucus carota,435058164,jpeg,cc-by,Saryu Mae
|
1674
1673
|
Daucus carota,115648219,jpeg,cc-by,Eleftherios Katsillis
|
1675
1674
|
Daucus carota,390996627,jpg,cc-by-nc,Avelino Vieira
|
1676
|
-
Daucus carota,115648186,jpeg,cc-by,Eleftherios Katsillis
|
1677
1675
|
Daucus carota,45271729,jpeg,cc-by-nc,lvconrad1977
|
1678
1676
|
Daucus pusillus,7606922,jpg,cc-by-nc,Philip Woods
|
1679
1677
|
Daucus pusillus,3456940,jpg,cc-by,NatureShutterbug
|
@@ -2253,8 +2251,8 @@ Erythranthe arvensis,139615007,jpg,cc-by,mark-groeneveld
|
|
2253
2251
|
Erythranthe arvensis,138889197,jpeg,cc-by-nc,Joey Santore
|
2254
2252
|
Erythranthe breweri,10301236,jpeg,cc-by-nc,Damon Tighe
|
2255
2253
|
Erythranthe breweri,17193,jpg,cc-by,Ken-ichi Ueda
|
2256
|
-
Erythranthe breweri,301588080,jpeg,cc-by-nc,
|
2257
|
-
Erythranthe breweri,301588359,jpeg,cc-by-nc,
|
2254
|
+
Erythranthe breweri,301588080,jpeg,cc-by-nc,juliamarkey
|
2255
|
+
Erythranthe breweri,301588359,jpeg,cc-by-nc,juliamarkey
|
2258
2256
|
Erythranthe breweri,4327500,jpeg,cc-by-nc,faerthen
|
2259
2257
|
Erythranthe cardinalis,4447174,jpg,cc-by-nc,Raphaela E. Floreani Buzbee
|
2260
2258
|
Erythranthe cardinalis,4035791,jpg,cc-by-nc,Jenny Smith
|
@@ -2449,8 +2447,6 @@ Festuca temulenta,39124250,jpeg,cc-by-nc,James Bailey
|
|
2449
2447
|
Festuca temulenta,39124273,jpeg,cc-by-nc,James Bailey
|
2450
2448
|
Ficus carica,3069933,jpg,cc-by,Drepanostoma
|
2451
2449
|
Ficus carica,217972106,jpeg,cc-by-nc,Errol Véla
|
2452
|
-
Ficus carica,38291711,jpeg,cc-by,Michele Jones
|
2453
|
-
Ficus carica,87770239,jpg,cc-by-nc,richardpatters
|
2454
2450
|
Ficus carica,126762573,jpg,cc-by-nc,Иван Матершев
|
2455
2451
|
Foeniculum vulgare,89318955,jpg,cc-by-nc,sstudebaker
|
2456
2452
|
Foeniculum vulgare,89168026,jpg,cc-by-nc,Eric Koberle
|
@@ -2668,10 +2664,7 @@ Hedera canariensis,249819535,jpg,cc-by-nc,Andriy Kovalchuk
|
|
2668
2664
|
Hedera canariensis,255805787,jpeg,cc-by-nc,David G. del Olmo
|
2669
2665
|
Hedera canariensis,170855930,jpeg,cc-by-nc,Sébastien SANT
|
2670
2666
|
Hedera helix,23968680,jpeg,cc-by,Gianni Del Bufalo bygdb
|
2671
|
-
Hedera helix,129890133,jpg,cc-by-nc,sveatoussaint
|
2672
2667
|
Hedera helix,38428455,jpeg,cc-by,Marianna Boi
|
2673
|
-
Hedera helix,63642529,jpeg,cc-by-nc,joe__hill
|
2674
|
-
Hedera helix,23968712,jpeg,cc-by,Gianni Del Bufalo bygdb
|
2675
2668
|
Hedypnois rhagadioloides,3156331,jpg,cc-by-nc,Bryan
|
2676
2669
|
Hedypnois rhagadioloides,37923304,jpeg,cc-by-nc,mustangmari
|
2677
2670
|
Hedypnois rhagadioloides,122232888,jpg,cc-by-nc,Богданович Светлана
|
package/data/synonyms.csv
CHANGED
@@ -89,10 +89,12 @@ Amerosedum radiatum,Sedum radiatum
|
|
89
89
|
Amerosedum radiatum subsp. radiatum,Sedum radiatum subsp. radiatum
|
90
90
|
Ammannia coccinea subsp. purpurea,Ammannia coccinea
|
91
91
|
Amsinckia gloriosa,Amsinckia tessellata var. gloriosa
|
92
|
+
Amsinckia helleri,Amsinckia retrorsa
|
92
93
|
Amsinckia intermedia var. eastwoodiae,Amsinckia eastwoodiae
|
93
94
|
Amsinckia intermedia var. echinata,Amsinckia intermedia
|
94
95
|
Amsinckia menziesii var. intermedia,Amsinckia intermedia,INAT
|
95
96
|
Amsinckia menziesii var. menziesii,Amsinckia menziesii
|
97
|
+
Amsinckia menziesii var. menziesii,Amsinckia retrorsa,INAT
|
96
98
|
Amsinckia micrantha,Amsinckia menziesii
|
97
99
|
Amsinckia straminea,Amsinckia lycopsoides
|
98
100
|
Amsinckia tessellata var. elegans,Amsinckia tessellata var. tessellata
|
package/data/taxa.csv
CHANGED
@@ -94,7 +94,8 @@ Amsinckia grandiflora,large-flowered fiddleneck,N,13130,323,75424,202030,,Large-
|
|
94
94
|
Amsinckia intermedia,fiddleneck,N,13131,11324,49141,202031,,Common Fiddleneck
|
95
95
|
Amsinckia lunaris,bent-flower fiddleneck,N,13139,324,75425,202032,,Bent Flowered Fiddleneck,,,,,5,1B.2,,,S3,G3
|
96
96
|
Amsinckia lycopsoides,,N,13140,325,58048,202033,,Bugloss-flowered Fiddleneck
|
97
|
-
Amsinckia menziesii,rancher's fireweed,N,13145,326,55436,202034,,Menzies' Fiddleneck
|
97
|
+
Amsinckia menziesii,rancher's fireweed,N,13145,326,55436,202034,,Menzies' Fiddleneck,annual,orange
|
98
|
+
Amsinckia retrorsa,rigid fiddleneck,N,13147,11325,58049,202037,,Rigid Fiddleneck,annual,yellow,2,5
|
98
99
|
Amsinckia tessellata var. gloriosa,,N,77019,333,80365,202042,,Carrizo Fiddleneck
|
99
100
|
Amsinckia tessellata var. tessellata,devil's lettuce,N,77020,334,58852,202043,,Desert Fiddleneck
|
100
101
|
Amsinckia vernicosa,,N,13155,335,58051,202027,,Green Fiddleneck
|
@@ -637,7 +638,7 @@ Elymus condensatus,giant wild-rye,N,24165,11636,164673,140055,Leymus condensatus
|
|
637
638
|
Elymus elymoides var. elymoides,squirreltail,N,72180,11639,58377,211223,Elymus elymoides subsp. elymoides,Squirreltail
|
638
639
|
Elymus glaucus subsp. glaucus,blue wildrye,N,50264,2937,57171,167143,true,Western Rye Grass
|
639
640
|
Elymus glaucus subsp. virescens,,N,50266,2939,61203,206754,true,Blue Wildrye
|
640
|
-
Elymus hispidus,wheatgrass,X,24153,11640,155848,140096,Thinopyrum intermedium
|
641
|
+
Elymus hispidus,wheatgrass,X,24153,11640,155848,140096,Thinopyrum intermedium
|
641
642
|
Elymus mollis subsp. mollis,,N,70142,11641,118426,206755,Leymus mollis subsp. mollis,Dune Wild Rye
|
642
643
|
Elymus multisetus,big squirreltail,N,24122,2941,57167,140134,true,Big Squirreltail
|
643
644
|
Elymus ponticus,tall wheatgrass,X,91896,11643,1301269,206756,Thinopyrum ponticum
|
@@ -784,7 +785,7 @@ Festuca elmeri,Elmer fescue,N,25798,3580,64333,141011,true,Elmer Fescue
|
|
784
785
|
Festuca idahoensis,Idaho fescue,N,25808,3581,61200,141076,true,Idaho Fescue
|
785
786
|
Festuca microstachys,,N,25865,11688,77138,141123,Vulpia microstachys var. ciliata,Pacific Fescue
|
786
787
|
Festuca myuros,zorro grass,X,25869,11689,77140,141133,Vulpia myuros
|
787
|
-
Festuca octoflora,six-week's fescue,N,25872,11690,77141,141148,Vulpia octoflora
|
788
|
+
Festuca octoflora,six-week's fescue,N,25872,11690,77141,141148,Vulpia octoflora,Six Weeks Fescue
|
788
789
|
Festuca perennis,Italian ryegrass,X,91964,11691,52801,203852,Lolium multiflorum
|
789
790
|
Festuca rubra,red fescue,N,25825,3586,61061,141223,true,Red Fescue
|
790
791
|
Festuca temulenta,darnel,X,93753,11692,164712,203853,Lolium temulentum
|
@@ -1558,7 +1559,7 @@ Romulea rosea var. australis,,X,65230,7162,68895,207249
|
|
1558
1559
|
Rorippa curvisiliqua,yellow cress,N,41580,7168,58866,30089,true,Curvepod Yellowcress
|
1559
1560
|
Rorippa palustris subsp. palustris,,N,52673,11988,64157,43562,true,Bog Yellowcress
|
1560
1561
|
Rosa californica,California rose,N,41631,7179,53437,30158,true,California Wildrose,,pink
|
1561
|
-
Rosa gymnocarpa,wood rose,N,41652,7182,53441,30212,true,
|
1562
|
+
Rosa gymnocarpa,wood rose,N,41652,7182,53441,30212,true,Wood Rose,,pink
|
1562
1563
|
Rosa rubiginosa,sweet-brier,X,41648,11057,78886,30313,true
|
1563
1564
|
Rosa spithamea,ground rose,N,41696,7187,53442,30338,true,Ground Rose
|
1564
1565
|
Rubus armeniacus,Himalayan blackberry,X,87465,10319,61317,30459
|
@@ -1738,7 +1739,7 @@ Stephanomeria virgata subsp. pleurocarpa,,N,6227,7806,58849,206092,true,Wand Wir
|
|
1738
1739
|
Stipa cernua,nodding needlegrass,N,45640,12042,165654,149288,Nassella cernua,Nodding Needle Grass
|
1739
1740
|
Stipa lemmonii var. lemmonii,Lemmon's needlegrass,N,73899,12053,1220756,173006,Achnatherum lemmonii subsp. lemmonii
|
1740
1741
|
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
|
1742
|
+
Stipa miliacea var. miliacea,smilo grass,X,91920,12058,524183,206097,Piptatherum miliaceum
|
1742
1743
|
Stipa pulchra,purple needlegrass,N,45644,12067,165659,149498,Nassella pulchra,Purple Needlegrass
|
1743
1744
|
Streptanthus albidus subsp. peramoenus,most beautiful jewelflower,N,53142,7814,58783,258754,Streptanthus glandulosus subsp. glandulosus,,,,,,1490,1B.2,,,S2,G2T2
|
1744
1745
|
Streptanthus breweri,,N,45725,7822,79258,32606,true,Brewer's Jewelflower
|
package/lib/externalsites.js
CHANGED
@@ -88,20 +88,26 @@ export class ExternalSites {
|
|
88
88
|
}
|
89
89
|
|
90
90
|
/**
|
91
|
-
* @param {
|
91
|
+
* @param {{taxon_id?:string,taxon_name?:string,subview?:"map"|"table",view?:"species"}} params
|
92
92
|
* @param {import("./config.js").Config} config
|
93
93
|
* @returns {URL|undefined}
|
94
94
|
*/
|
95
|
-
static getInatObsLink(
|
96
|
-
const iNatID = taxon.getINatID();
|
97
|
-
if (!iNatID) {
|
98
|
-
return;
|
99
|
-
}
|
100
|
-
|
95
|
+
static getInatObsLink(params, config) {
|
101
96
|
const url = new URL(
|
102
|
-
"https://www.inaturalist.org/observations?subview=map",
|
97
|
+
"https://www.inaturalist.org/observations?subview=map&iconic_taxa=Plantae",
|
103
98
|
);
|
104
|
-
|
99
|
+
if (params.subview) {
|
100
|
+
url.searchParams.set("subview", params.subview);
|
101
|
+
}
|
102
|
+
if (params.taxon_id) {
|
103
|
+
url.searchParams.set("taxon_id", params.taxon_id);
|
104
|
+
}
|
105
|
+
if (params.taxon_name) {
|
106
|
+
url.searchParams.set("taxon_name", params.taxon_name);
|
107
|
+
}
|
108
|
+
if (params.view) {
|
109
|
+
url.searchParams.set("view", params.view);
|
110
|
+
}
|
105
111
|
for (const p of ["place_id", "project_id"]) {
|
106
112
|
const v = config.getConfigValue("inat", p);
|
107
113
|
if (v) {
|
package/lib/htmltaxon.js
CHANGED
@@ -60,7 +60,11 @@ const OBSLINKS = {
|
|
60
60
|
},
|
61
61
|
inat: {
|
62
62
|
label: "iNaturalist",
|
63
|
-
href: (taxon, config) =>
|
63
|
+
href: (taxon, config) =>
|
64
|
+
ExternalSites.getInatObsLink(
|
65
|
+
{ taxon_id: taxon.getINatID() },
|
66
|
+
config,
|
67
|
+
),
|
64
68
|
},
|
65
69
|
};
|
66
70
|
|
@@ -120,6 +124,45 @@ class HTMLTaxon {
|
|
120
124
|
*/
|
121
125
|
static addObsLink(links, taxon, config, sourceCode, label) {
|
122
126
|
const source = OBSLINKS[sourceCode];
|
127
|
+
if (sourceCode === "inat") {
|
128
|
+
const iNatName = taxon.getINatName().split(" ");
|
129
|
+
/** @type {string[]} */
|
130
|
+
const iNatLinks = [];
|
131
|
+
iNatLinks.push(
|
132
|
+
HTML.getLink(
|
133
|
+
ExternalSites.getInatObsLink(
|
134
|
+
{ taxon_name: iNatName[0], view: "species" },
|
135
|
+
config,
|
136
|
+
),
|
137
|
+
`Genus ${iNatName[0]}`,
|
138
|
+
undefined,
|
139
|
+
true,
|
140
|
+
),
|
141
|
+
);
|
142
|
+
if (iNatName.length > 2) {
|
143
|
+
const species = `${iNatName[0]} ${iNatName[1]}`;
|
144
|
+
iNatLinks.push(
|
145
|
+
HTML.getLink(
|
146
|
+
ExternalSites.getInatObsLink(
|
147
|
+
{ taxon_name: species },
|
148
|
+
config,
|
149
|
+
),
|
150
|
+
species,
|
151
|
+
undefined,
|
152
|
+
true,
|
153
|
+
),
|
154
|
+
);
|
155
|
+
}
|
156
|
+
this.addLink(
|
157
|
+
iNatLinks,
|
158
|
+
source.href(taxon, config),
|
159
|
+
taxon.getINatSyn() ?? taxon.getName(),
|
160
|
+
);
|
161
|
+
|
162
|
+
const html = HTML.textElement("span", label ?? source.label);
|
163
|
+
links.push(html + HTML.wrap("ul", HTML.arrayToLI(iNatLinks)));
|
164
|
+
return;
|
165
|
+
}
|
123
166
|
this.addLink(links, source.href(taxon, config), label ?? source.label);
|
124
167
|
}
|
125
168
|
|
package/lib/tools/inat.js
CHANGED
@@ -3,6 +3,7 @@ import { Files } from "../files.js";
|
|
3
3
|
import { CSV } from "../csv.js";
|
4
4
|
import { sleep } from "../util.js";
|
5
5
|
import { TaxaCSV } from "./taxacsv.js";
|
6
|
+
import { SynCSV } from "./syncsv.js";
|
6
7
|
|
7
8
|
/**
|
8
9
|
* @typedef {{id:string,
|
@@ -65,8 +66,10 @@ export class INat {
|
|
65
66
|
|
66
67
|
const missingTaxa = [];
|
67
68
|
|
68
|
-
|
69
|
+
/** @type {Map<string,string>} */
|
69
70
|
const idsToUpdate = new Map();
|
71
|
+
/** @type {import("./syncsv.js").SynData[]} */
|
72
|
+
const synonymsToAdd = [];
|
70
73
|
|
71
74
|
for (const taxon of taxa.getTaxonList()) {
|
72
75
|
const name = taxon.getName();
|
@@ -103,12 +106,14 @@ export class INat {
|
|
103
106
|
errorLog,
|
104
107
|
data.name,
|
105
108
|
data.iNatName,
|
109
|
+
synonymsToAdd,
|
106
110
|
);
|
107
111
|
}
|
108
112
|
|
109
113
|
this.#checkExceptions(taxa, exceptions, errorLog);
|
110
114
|
|
111
115
|
if (update) {
|
116
|
+
updateSynCSV(dataDir, synonymsToAdd);
|
112
117
|
updateTaxaCSV(dataDir, idsToUpdate);
|
113
118
|
}
|
114
119
|
}
|
@@ -167,14 +172,21 @@ export class INat {
|
|
167
172
|
}
|
168
173
|
|
169
174
|
/**
|
170
|
-
*
|
171
175
|
* @param {import("../types.js").Taxa} taxa
|
172
176
|
* @param {import("../exceptions.js").Exceptions} exceptions
|
173
177
|
* @param {import("../errorlog.js").ErrorLog} errorLog
|
174
178
|
* @param {string} name
|
175
179
|
* @param {string} iNatName
|
180
|
+
* @param {import("./syncsv.js").SynData[]} synonymsToAdd
|
176
181
|
*/
|
177
|
-
static async #findCurrentName(
|
182
|
+
static async #findCurrentName(
|
183
|
+
taxa,
|
184
|
+
exceptions,
|
185
|
+
errorLog,
|
186
|
+
name,
|
187
|
+
iNatName,
|
188
|
+
synonymsToAdd,
|
189
|
+
) {
|
178
190
|
/**
|
179
191
|
* @param {{matched_term:string,name:string,rank:string}[]} results
|
180
192
|
* @param {string} iNatName
|
@@ -242,11 +254,17 @@ export class INat {
|
|
242
254
|
}
|
243
255
|
}
|
244
256
|
} else {
|
257
|
+
const formerName = this.makeSynonymName(result, errorLog);
|
245
258
|
errorLog.log(
|
246
259
|
name,
|
247
260
|
"found iNat synonym",
|
248
|
-
|
261
|
+
formerName + "," + name + ",INAT",
|
249
262
|
);
|
263
|
+
synonymsToAdd.push({
|
264
|
+
Former: formerName,
|
265
|
+
Current: name,
|
266
|
+
Type: "INAT",
|
267
|
+
});
|
250
268
|
}
|
251
269
|
|
252
270
|
// Delay to throttle queries to iNat API.
|
@@ -297,6 +315,17 @@ class InatTaxon {
|
|
297
315
|
}
|
298
316
|
}
|
299
317
|
|
318
|
+
/**
|
319
|
+
* @param {string} dataDir
|
320
|
+
* @param {import("./syncsv.js").SynData[]} synonymsToAdd
|
321
|
+
*/
|
322
|
+
function updateSynCSV(dataDir, synonymsToAdd) {
|
323
|
+
const csv = new SynCSV(dataDir);
|
324
|
+
const data = csv.getData();
|
325
|
+
data.push(...synonymsToAdd);
|
326
|
+
csv.write();
|
327
|
+
}
|
328
|
+
|
300
329
|
/**
|
301
330
|
* @param {string} dataDir
|
302
331
|
* @param {Map<string,string>} idsToUpdate
|