1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "requests": [
12 "0+00 cut 0 fill 0; 1+00 cut 120 fill 0; 2+00 cut 185 fill 0; 3+00 cut 90 fill 15; 4+00 cut 20 fill 80; 5+00 cut 0 fill 160; 6+00 cut 0 fill 110; 7+00 cut 0 fill 0 sq ft; shrinkage 10%",
13 "borrow pit grid 20 ft squares, cut depths: 2.1 1.8 1.5 1.2; 1.9 1.4 1.0 0.6; 1.2 0.8 0.5 -0.3 ft",
14 "grid 10 m squares, existing elevations: 102.4 101.9 101.2; 101.8 101.0 100.6; 101.1 100.4 99.8",
15 "pit 20 x 30 m bottom, 3 m deep, side slopes 1.5:1, swell 25%, trucks of 10 m3",
16 "trench 100 ft long, 3 ft wide, 6 ft deep, side slopes 1:1",
17 "conical stockpile 40 ft diameter, 12 ft high",
18 {
19 "type": "sections",
20 "sections": [
21 {
22 "station": "0+000",
23 "cut": 45,
24 "fill": 0
25 },
26 {
27 "station": "0+020",
28 "cut": 30,
29 "fill": 5
30 },
31 {
32 "station": "0+040",
33 "cut": 0,
34 "fill": 38
35 },
36 {
37 "station": "0+060",
38 "cut": 0,
39 "fill": 20
40 }
41 ],
42 "shrinkage": "15%",
43 "units": "m"
44 }
45 ]
46};
47
48
49const run = await client.actor("jumblemog/earthwork-calculator").call(input);
50
51
52console.log('Results from dataset');
53console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
54const { items } = await client.dataset(run.defaultDatasetId).listItems();
55items.forEach((item) => {
56 console.dir(item);
57});
58
59