For the hackathon, this repo has been made a part of the frontend repository: https://github.com/BKK-WeSpace/tree-population
For now, if you POST to /trees, you'll get the position of 5 random trees in the lumpini park. This is just help integrating with the frontend.
npm install
npm run dev
Everything here is subjected to heavy change
Gets all tree within a given GeoJson polygon object.
// Request
type TreesRequest = {
coordinates: number[][]
}
// Response
type TreesResponse = {
trees: Tree[];
}
interface Tree {
properties?: {
commonName?: string;
species?: string;
genus?: string;
quote?: TreeQuote & {
quote?: string;
description?: string;
};
appearance?: {
color?: string;
imgLink?: string;
};
carbonProfile?: {
carbonAbsorption?: {
amount: number;
unit: string;
per: "year" | "month" | "day";
};
o2Emission?: {
amount: number;
unit: string;
per: "year" | "month" | "day";
};
};
};
}
Uploads an image to the server to be stored in the database, as well as upload the data to an open database.
interface TreeUploadRequest {
base64Image: string;
}
Response: void