-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
57 lines (51 loc) · 1.65 KB
/
test.py
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
from core.main import create_map
def take_screenshot(lat: float, long: float, row: int, col: int, number: int, file_name: str, gmaps: bool,
gmaps_satellite: bool, zoom: int, osm: True, crop_status: bool):
"""
Args:
col: Column count
file_name: File name of the images
gmaps: Google Maps View
gmaps_satellite: Google Maps Satellite
lat: Latitude of the left corner
long: Longitude of the left corner
number: Numbering to output file
row: Row count
osm: Open Street Map
zoom: Zoom value
Returns:
"""
create_map(
crop_size=15,
crop_status=crop_status,
gmaps=gmaps,
gmaps_satellite=gmaps_satellite,
lat_start=lat,
long_start=long,
number=number,
number_rows=row,
number_cols=col,
scale=0.5,
sleep_time=2,
offset_left=0,
offset_top=0.17,
offset_right=0,
offset_bottom=0.10,
osm=osm,
outfile=file_name,
zoom=zoom, # can be changed to match OSM with GMaps
)
# Example: 2x2 -> 4 images
take_screenshot(
lat=39.9776334, # Top left corner latitude
long=-83.009591, # Top left corner longitude
row=2, # 2 rows
col=2, # 2 cols
crop_status=True, # Crop status of the output
file_name="image", # Map image: "/images/test-{number}.png"
number=1, # Starting from 0 like image-0.png, image-1-normal.png ...
gmaps=False, # Take screenshot from Google Maps
gmaps_satellite=False, # Take screenshot from Google Maps Satellite
osm=True, # Generate screenshots from OSM
zoom=19,
)