Generate a unique tree id based on properties of the tree (e.g. sourceId or city, species or scientific name, lat/lng coordinates).
Install this library as a dependency in your project:
npm install --save @waterthetrees/tree-id
Import and use the module:
import { createIdForTree } from '@waterthetrees/tree-id';
const treeId = createIdForTree({
species: 'Lagerstromia Indica',
city: 'san_francisco',
lat: 37.713225870641935,
lng: -122.45009922742373,
});
console.log(treeId);
import { createIdForTree } from '@waterthetrees/tree-id';
const treeId = createIdForTree({
scientific: 'Lagerstromia Indica',
sourceId: 'san_francisco',
lat: 37.713225870641935,
lng: -122.45009922742373,
});
console.log(treeId);