1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "calculations": [
12 {
13 "label": "Empire State Building",
14 "type": "convert",
15 "point": "40.748440, -73.985664"
16 },
17 {
18 "label": "Eiffel Tower from degrees, minutes and seconds",
19 "type": "convert",
20 "point": "48°51'30.1\"N 2°17'40.1\"E"
21 },
22 {
23 "label": "Sydney Opera House from latitude and longitude",
24 "type": "convert",
25 "latitude": -33.856784,
26 "longitude": 151.215297
27 },
28 {
29 "label": "Decode a geohash",
30 "type": "convert",
31 "point": "u4pruydqqvj"
32 },
33 {
34 "label": "Decode an MGRS reference",
35 "type": "convert",
36 "point": "31UDQ4825011951"
37 },
38 {
39 "label": "New York to London",
40 "type": "distance",
41 "point": "40.7128, -74.0060",
42 "point2": "51.5074, -0.1278"
43 },
44 {
45 "label": "100 km due east of Greenwich",
46 "type": "destination",
47 "point": "51.4778, -0.0015",
48 "bearing": 90,
49 "distanceKm": 100
50 },
51 {
52 "label": "10 km bounding box around Times Square",
53 "type": "bbox",
54 "point": "40.7580, -73.9855",
55 "radiusKm": 10
56 }
57 ]
58};
59
60
61const run = await client.actor("mangudai/gps-coordinate-converter").call(input);
62
63
64console.log('Results from dataset');
65console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
66const { items } = await client.dataset(run.defaultDatasetId).listItems();
67items.forEach((item) => {
68 console.dir(item);
69});
70
71