forked from nst/gmap_tiles
-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.py
executable file
·27 lines (25 loc) · 983 Bytes
/
main.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
from sources import *
from download_tiles import *
from merge_tiles import *
import webbrowser #just for opening the results of this test
def main():
print 'Loading Region Information'
zoom = 10
lat_start, lon_start = 36.99, -114.03 #Grand Canyon USA (top left corner)
lat_stop, lon_stop = 35.64, -111.60 #(bottom right corner)
coord = (lat_start, lat_stop, lon_start, lon_stop) #Will error if wrong corners specified
fname = 'sources.json'
source_type = {'type':'sat'}
found_sources = searchSource(fname, source_type)
ppjson(found_sources)
key = found_sources.keys()[0] #Just try first
source = {key: found_sources[key]}
ext = source[key]
print 'Downloading Tiles'
downloadTiles(source, zoom, coord, max_threads=1)
print 'Merging Tiles'
img_name = mergeTiles(source, zoom, coord)
print 'Done'
webbrowser.open(img_name)
if __name__ == '__main__':
main()