1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "geojson": {
12 "type": "FeatureCollection",
13 "features": [
14 {
15 "type": "Feature",
16 "properties": {
17 "producer_name": "Kofi Mensah",
18 "country": "Ghana",
19 "area": "2,5"
20 },
21 "geometry": {
22 "type": "Polygon",
23 "coordinates": [
24 [
25 [
26 -1.620112,
27 6.680134
28 ],
29 [
30 -1.610145,
31 6.690121
32 ],
33 [
34 -1.610133,
35 6.680156
36 ],
37 [
38 -1.620187,
39 6.690178
40 ],
41 [
42 -1.620112,
43 6.680134
44 ]
45 ]
46 ]
47 }
48 },
49 {
50 "type": "Feature",
51 "properties": {
52 "ProducerName": "Ama Owusu",
53 "ProducerCountry": "GH"
54 },
55 "geometry": {
56 "type": "Polygon",
57 "coordinates": [
58 [
59 [
60 -1.530021,
61 6.700034,
62 210
63 ],
64 [
65 -1.530045,
66 6.710012,
67 211
68 ],
69 [
70 -1.520078,
71 6.710056,
72 212
73 ],
74 [
75 -1.520011,
76 6.700089,
77 213
78 ]
79 ]
80 ]
81 }
82 },
83 {
84 "type": "Feature",
85 "properties": {
86 "ProducerName": "Budi Santoso",
87 "ProducerCountry": "IDN",
88 "Area": "1.8 ha"
89 },
90 "geometry": {
91 "type": "Point",
92 "coordinates": [
93 -0.512345,
94 110.412345
95 ]
96 }
97 }
98 ]
99 }
100};
101
102
103const run = await client.actor("translucent_wire/eudr-plot-file-fixer").call(input);
104
105
106console.log('Results from dataset');
107console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
108const { items } = await client.dataset(run.defaultDatasetId).listItems();
109items.forEach((item) => {
110 console.dir(item);
111});
112
113