-
Notifications
You must be signed in to change notification settings - Fork 16
/
config.sample.ini
268 lines (240 loc) · 15.5 KB
/
config.sample.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# Hello! This is the configuration for ærialbot. It's written in ConfigObj's
# "unrepr" dialect, which basically means that the values of the key-value pairs
# observe the usual Python semantics.
[GENERAL]
# This option steers how talkative ærialbot is on the command line. If set to
# "quiet", only errors are output. If set to "verbose", status messages are
# printed as well, along with a snazzy progress indicator during tile download
# (if you prefer a not-quite-so-snazzy progress indicator, set this option to
# "normal" instead). If set to "deafening", all kinds of debugging information
# is printed, too. Should you be planning to run ærialbot as a cronjob or
# similar, I recommend the "quiet" setting, while "deafening" is well-suited for
# testing.
verbosity = "verbose"
# If not set to None, whatever would be printed in the "deafening" output mode
# (but not the progress indicator) will be written to this file as well. This
# log is not autorotated – so it'll grow to fill your hard drive on an infinite
# time scale.
logfile = "/PATH/TO/aerialbot/aerialbot.log"
# Temporary storage location for tiles, allowing them to be cached and reused.
# Note 1: ærialbot doesn't delete old images, so given enough time, the storage
# directory will grow to fill your hard drive.
# Note 2: You can set this setting to None, though – this will disable tile
# caching altogether.
# Note 3: Make sure to supply an absolute path here – otherwise it will be
# interpreted relative to the current working directory, which is not what you
# want when running ærialbot via cron or something like that.
# Note 4: The file extension must match the format of your tiles (see further
# down).
# Note 5: The "hash" variable is a hash of the tile URL template configurable
# further down. This is to avoid recalling cached imagery from a different
# service (or version) than the one currently in use, which can happen when
# using the same directory to store tiles from different ærialbot instances.
# Note 6: The "angle_if_oblique" variable evaluates to an empty string if the
# "tile_url_template" option isn't one of the "googlemaps-oblique-*" variants.
tile_path_template = "/PATH/TO/aerialbot/aerialbot-tiles/{angle_if_oblique}z{zoom}x{x}y{y}-{hash}.jpg"
# Path where the result image will be stored. You can use the following
# variables (some of which are directly derived from the config options
# described further down) in your filename:
# | variable | example value |
# | ---------------------- | ------------------------------------------ |
# | {datetime} | 2020-04-01T20.40.22 |
# | {direction} | downward |
# | {latitude} | 37.627192021264214 |
# | {longitude} | -107.98992174140965 |
# | {width} | 1610 |
# | {height} | 1610 |
# | {max_meters_per_pixel} | 0.5 |
# | {xmin} | 26214 |
# | {xmax} | 26222 |
# | {ymin} | 50726 |
# | {ymax} | 50734 |
# | {zoom} | 17 |
# | {georect} | sw35.20686,-118.99304ne35.22483,-118.96006 |
# Note 1: Similar caveats as above apply regarding deletion and absolute paths.
# You must not set this setting to None, though – but specifying a constant
# filename (i.e. not using any of the variables) ensures that only the most
# recent image is kept in the file system at all times.
# Note 2: Here, you can choose a different file type (among the ones PIL
# supports, anyway).
image_path_template = "/PATH/TO/aerialbot/aerialbot-{datetime}-{direction}-{latitude},{longitude}-{width}x{height}m-z{zoom}.jpg"
# Number of retries (starting at random point generation and proceeding from
# there) that should be performed if there's no sufficiently-high-quality
# imagery for a randomly generated point at the relevant zoom level.
max_tries = 10
# The highest available zoom level is frequently blurry or pixelated. To avoid
# tweeting such imagery, ærialbot checks whether imagery exists for a higher
# zoom level than was selected. This option sets that delta – e.g. if the
# selected zoom level is 16 and this option is set to 2, zoom level 18 will be
# checked and, if there's no imagery for it, another random point will be
# generated (see "max_retries" option above). If set to 0, the quality check is
# effectively skipped (it still takes place, but really just preloads the corner
# tiles). Don't set this option to a value larger than 4.
quality_check_delta = 2
[GEOGRAPHY]
# The URL scheme that map tiles will be downloaded from. You can use any of the
# following variables:
# | variable | example value |
# | --------------------- | ------------- |
# | {x} | 50292 |
# | {y} | 395 |
# | {zoom} | 16 |
# For simplicity's sake, there's also a number of presets - specify one of them
# and ærialbot will take care of the rest:
# * "googlemaps"
# * "googlemaps-oblique-northward"
# * "googlemaps-oblique-eastward"
# * "googlemaps-oblique-southward"
# * "googlemaps-oblique-westward"
# * "googlemaps-oblique-random" (randomly selects one of the four directions)
# * "navermap" (only provides high-resolution imagery for South Korea)
# Note 1: The "googlemaps-oblique-*" presets access the 45-degree imagery Google
# Maps makes available when zooming into many cities around the world, giving
# buildings and other structures some dimensionality. Such imagery is usually
# derived from 3D models, so it may look a bit off (at the time of writing, the
# Empire State Building looks rather distorted, for example). Note that
# "northward" yields a north-looking view (showing the south face of buildings).
# Also note that the foreshortening inherent in a 45-degree side-on view means
# that a square geographical area corresponds to an image with a 1:√2 aspect
# ratio.
# Note 2: This tool isn't specific to Google Maps or Naver Map – most online
# mapping services also use 256x256 px tiles that are laid out based on the Web
# Mercator projection (https://en.wikipedia.org/wiki/Web_Mercator_projection).
# A somewhat outdated list of tile providers can be found at
# https://github.com/ANAT01/map-list-servers/.
tile_url_template = "googlemaps"
# Absolute path (as above) to the shapefile used for random location selection
# in a region, country or continent.
# Note 1: ærialbot isn't very sophisticated – it's only built to deal with
# shapefiles that follow the following convention (see shapefiles/README.md for
# a guide on how to make arbitrary shapefiles conform to this standard):
# 1. The shapefile contains a single layer
# 2. with one or more records/shapes
# 3. of type POLYGON
# 4. whose points are notated as longitude-latitude pairs (CRS: +proj=longlat).
# Note 2: ærialbot is quite sophisticated – the distribution of random points
# takes into account that at high latitudes, neighboring meridians are closer
# together than at the equator. (If a uniform distribution on latitudes and
# longitudes was used instead, random points would be biased towards the poles.)
shapefile = "/PATH/TO/aerialbot/shapefiles/usa/usa.shp"
# Alternatively, you can – for testing purposes, for example – set a geopoint,
# i.e. a latitude-longitude pair. If this point is not None, it will be used
# instead of a random point from the shapefile, which will then not even be
# loaded.
# Note: point = (35.215849, -118.976555) is quite handy for testing.
point = None
# The following two settings determine the dimensions of the depicted area in
# meters.
# Note 1: This, too, accounts for meridians being closer together at high
# latitudes and the implications this has when combines with the Mercator
# projection – the bottom line is that you don't have to worry about such
# details, if you set the width to 1000 meters, the result image is going to
# cover an area that's 1000 meters wide, whether the selected location is in
# Ecuador or in Greenland.
# Note 2: Of course, the available imagery might be distorted a bit, but that's
# not within the control of this tool.
# Note 3: A mile is about 1610 meters.
width = 2000
height = 2000
[IMAGE]
# ærialbot can automatically resize the result image to your desired dimensions.
# * If you specify only image width or height (i.e. set the other value to None)
# the other value will be inferred automatically.
# * If you set both image width and height here, the result image may end up
# distorted if they don't match the width and height of the depicted area
# (accounting for foreshortening if an oblique view is configured).
# * And if you set both of them to None, the resolution will not be changed from
# the original map tiles. Note that this can result in widely different image
# sizes depending on the selected latitude. Plus, in this case you MUST set a
# value for the max_meters_per_pixel setting.
image_width = 1000
image_height = None
# This setting, which sets the maximally allowable meters contained in a single
# pixel of the result image (i.e. after scaling to image_width/image_height),
# determines the required tile zoom level, setting it as coarse as possible (to
# conserve bandwidth and processing overhead) while still fulfilling this
# constraint.
# * It is required if you have specified neither image width nor image height,
# otherwise it's optional.
# * If you have specified an image width but not an image height, your value of
# this setting is multiplied with the width of the depicted area divided by
# image width. If this setting it set to None, 1 will be used in its place –
# this guarantees that at least 1 tile pixel corresponds to each result pixel.
# In other words, in this situation, this option turns into a way of
# retrieving higher-than-required-resolution imagery that's then scaled down
# again, e.g. specifying 0.5 yields twice the resolution, which can be handy
# in rare situations.
# * If you have specified an image height but no image width, it's analogous.
# * If you have specified both, whichever of the previously explained two
# variants imposes a tighter constraint is used.
# Note 1: Basically, smaller values here lead to crisper detail.
# Note 2: Satellite imagery is not available in high detail for all regions of
# the world (even in places like the US), so a value lower than 1 may lead to a
# high number of retries during the random point selection process.
max_meters_per_pixel = None
# Whether to amp up the colors and contrast a little bit.
apply_adjustments = True
# Which level of quality to target during JPEG compression (between 0 and 100,
# higher values imply higher quality but larger files).
image_quality = 90
[TWITTER]
# Information required for posting to Twitter using its OAuth 1a authentication
# method. Check out the following website for an explanation of how to generate
# these keys/tokens/secrets for your Twitter account:
# https://iag.me/socialmedia/how-to-create-a-twitter-app-in-8-easy-steps/
# Note: If any of these four values is set to None, Twitter posting will be
# disabled, but the result images will still be generated as configured.
consumer_key = None
consumer_secret = None
access_token = None
access_token_secret = None
# The text of each tweet. You can use the following variables in your string:
# | variable | example value |
# | ---------------------- | -------------------------------------------------------------------------- |
# | {direction} | westward |
# | {direction_capitalize} | Downward |
# | {latitude} | 38.93490955793527 |
# | {longitude} | -87.71460377200692 |
# | {point_fancy} | 35°12'57.1"N 118°58'35.6"W |
# | {area_size} | 34.74 × 19.52 km |
# | {osm_url} | https://www.openstreetmap.org/#map=18/40.84034204865187/-73.93902731230716 |
# | {googlemaps_url} | https://www.google.com/maps/@40.84034204865187,-73.93902731230716,18z |
# | {location_full_name} | Manhattan, NY |
# | {location_country} | Republic of Korea |
# | {location_globe_emoji} | 🌏 |
# Note: The location data is retrieved via the Twitter API. If Twitter doesn't
# know a place (e.g. if the geopoint is located in the ocean), the last two
# variables may be empty strings.
tweet_text = "{point_fancy}"
# Whether to include the latitude and longitude of the randomly selected point
# in the Tweet metadata. Twitter users will see which country, state or town
# it's in depending on what Twitter's backend location database provides for the
# given location.
# Note: In order for this metadata to be displayed, you must enable "Add
# location information to my Tweets" in the "Location information" tab of your
# "Privacy and safety" settings on twitter.com.
include_location_in_metadata = True
[MASTODON]
# Information required for posting to Mastodon. Go to your bot account's
# settings, "Development", "New Application", decide on an application name and
# select the "write:media" and "write:statuses" scopes (and unselect everything
# else just in case), click "Submit", then click on the newly created
# application's name – you'll find the access token there.
# Note: If any of these two values is set to None, Mastodon posting will be
# disabled, but the result images will still be generated as configured.
api_base_url = "https://botsin.space"
access_token = None
# The text of each toot. You can use the following variables in your string:
# | variable | example value |
# | ---------------------- | -------------------------------------------------------------------------- |
# | {direction} | westward |
# | {direction_capitalize} | Downward |
# | {latitude} | 38.93490955793527 |
# | {longitude} | -87.71460377200692 |
# | {point_fancy} | 35°12'57.1"N 118°58'35.6"W |
# | {area_size} | 34.74 × 19.52 km |
# | {osm_url} | https://www.openstreetmap.org/#map=18/40.84034204865187/-73.93902731230716 |
# | {googlemaps_url} | https://www.google.com/maps/@40.84034204865187,-73.93902731230716,18z |
# | {location_globe_emoji} | 🌏 |
# Note: No location data (for now) – Mastodon doesn't offer an API for this.
toot_text = "{point_fancy}"