1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "locationsJson": [
10 {
11 "location_id": "inside",
12 "latitude": 1,
13 "longitude": 1,
14 },
15 {
16 "location_id": "outside",
17 "latitude": 20,
18 "longitude": 20,
19 },
20 {
21 "location_id": "boundary",
22 "latitude": 0,
23 "longitude": 5,
24 },
25 {
26 "location_id": "overlap",
27 "latitude": 8,
28 "longitude": 8,
29 },
30 {
31 "location_id": "hole",
32 "latitude": 4,
33 "longitude": 4,
34 },
35 {
36 "location_id": "invalid",
37 "latitude": 95,
38 "longitude": 1,
39 },
40 {
41 "location_id": "duplicate",
42 "latitude": 1,
43 "longitude": 1,
44 },
45 ],
46 "serviceAreasGeoJson": {
47 "type": "FeatureCollection",
48 "features": [
49 {
50 "type": "Feature",
51 "id": "central",
52 "properties": {},
53 "geometry": {
54 "type": "Polygon",
55 "coordinates": [
56 [
57 [
58 0,
59 0,
60 ],
61 [
62 10,
63 0,
64 ],
65 [
66 10,
67 10,
68 ],
69 [
70 0,
71 10,
72 ],
73 [
74 0,
75 0,
76 ],
77 ],
78 [
79 [
80 3,
81 3,
82 ],
83 [
84 3,
85 5,
86 ],
87 [
88 5,
89 5,
90 ],
91 [
92 5,
93 3,
94 ],
95 [
96 3,
97 3,
98 ],
99 ],
100 ],
101 },
102 },
103 {
104 "type": "Feature",
105 "id": "east",
106 "properties": {},
107 "geometry": {
108 "type": "Polygon",
109 "coordinates": [[
110 [
111 7,
112 7,
113 ],
114 [
115 12,
116 7,
117 ],
118 [
119 12,
120 12,
121 ],
122 [
123 7,
124 12,
125 ],
126 [
127 7,
128 7,
129 ],
130 ]],
131 },
132 },
133 ],
134 },
135 "areaPriority": [],
136}
137
138
139run = client.actor("afkdigital/service-area-coverage-validator").call(run_input=run_input)
140
141
142print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
143for item in client.dataset(run.default_dataset_id).iterate_items():
144 print(item)
145
146