2
2
3
3
import Image as mod_image
4
4
import ImageDraw as mod_imagedraw
5
- import srtm . retriever as mod_retriever
5
+ import srtm as mod_srtm
6
6
7
7
def get_color_between (color1 , color2 , i ):
8
8
""" i is a number between 0 and 1, if 0 then color1, if 1 color2, ... """
@@ -25,7 +25,7 @@ def get_color_between(color1, color2, i):
25
25
# Zašto ovo pukne?
26
26
#start_latitude, start_longitude = 43.0, 14.0
27
27
28
- geo_elevation_data = mod_retriever . get_geo_elevation_data ()
28
+ geo_elevation_data = mod_srtm . get_data ()
29
29
geo_file = geo_elevation_data .get_file (start_latitude , start_longitude )
30
30
31
31
side = geo_file .square_side
@@ -40,9 +40,12 @@ def get_color_between(color1, color2, i):
40
40
for column in range (side ):
41
41
elevation = geo_file .get_elevation_from_row_and_column (row , column )
42
42
43
- elevation_coef = elevation / float (max_elevation )
44
- if elevation_coef < 0 : elevation_coef = 0
45
- if elevation_coef > 1 : elevation_coef = 1
43
+ if elevation != None :
44
+ elevation_coef = elevation / float (max_elevation )
45
+ if elevation_coef < 0 : elevation_coef = 0
46
+ if elevation_coef > 1 : elevation_coef = 1
47
+ else :
48
+ elevation_coef = ZERO_COLOR
46
49
47
50
color = get_color_between (MIN_COLOR , MAX_COLOR , elevation_coef )
48
51
if elevation <= 0 :
0 commit comments