Example #1
0
def build_points_sat():
    d=dist(sat[0][0],sat[0][1],sat[1][0],sat[1][1])
    s=round(d/STEP_SIZE)#number of steps to obtain grid with step-size
    
    for i in range(int(s)+1):
        #adds all points between beginning and end of satellite path
        points_sat.append((sat[0][0]+i/s*(sat[1][0]-sat[0][0]),sat[0][1]+i/s*(sat[1][1]-sat[0][1]))) 
Example #2
0
def build_points_map():#devides the map into 1x(step-size)-arrays; this structure is required for plotting
    
    d=dist(corner_bl[0],corner_bl[1],corner_br[0],corner_br[1])

    u=round(d/STEP_SIZE)
    for j in range(int(u)):#up
        points_map_j=[]
        for i in range(int(u)):#right
            #adds all points between j-th and (j+1)st section to spree_j
            points_map_j.append((corner_bl[0]+j/u*(corner_tl[0]-corner_bl[0]),corner_bl[1]+i/u*(corner_br[1]-corner_bl[1]))) 
            if j==0:
                latitudes.append(corner_bl[1]+i/u*(corner_br[1]-corner_bl[1]))
            if i==0:
                longitudes.append(corner_bl[0]+j/u*(corner_tl[0]-corner_bl[0]))
    
        points_map.append(points_map_j) 
Example #3
0
def build_points_spree():
    
    for j in range(len(spree)-1):
        
        spree_j=[] #list of pints on j-th section of river spree
        spree_j.append(spree[j])
        spree_j.append(spree[j+1])
        
        d_j=dist(spree[j][0],spree[j][1],spree[j+1][0],spree[j+1][1])
        s_j=round(d_j/STEP_SIZE) #number of steps to obtain gris with size step-size
    
        for i in range(int(s_j)+1):
            #adds all points between j-th and (j+1)st section to spree_j
            spree_j.append((spree_j[0][0]+i/s_j*(spree_j[1][0]-spree_j[0][0]),spree_j[0][1]+i/s_j*(spree_j[1][1]-spree_j[0][1])))
        spree_j.pop()  
        points_spree.extend(spree_j)  #adds j-th section of spree to total spree
        
    points_spree.append(spree[len(spree)-1])