def get_ceiling_floor_at_point(airspace, point): ceil,floor = None, None if airspace.ceil_fl != -1: ceil = airspace.ceil_fl * 100 * 0.3048 elif airspace.ceil_ref and airspace.ceil_ref == 'AGL': try: h = ossim.height(point[1], point[0]) ceil = airspace.ceil_alti_m + h[1] except: ## most probably: no ground info :( ceil = 0 elif airspace.ceil_ref and airspace.ceil_ref == 'AMSL': ceil = airspace.ceil_alti_m elif airspace.ceil_unl: ceil = 100000 else: print "unexpected ceil spec for", airspace if airspace.flr_fl != -1: floor = airspace.flr_fl * 100 * 0.3048 elif airspace.flr_ref and airspace.flr_ref == 'AGL': try: h = ossim.height(point[1], point[0]) floor = airspace.flr_alti_m + h[1] except: ## most probably: no ground info :( floor = 0 elif airspace.flr_ref and airspace.flr_ref == 'AMSL': floor = airspace.flr_alti_m elif airspace.flr_f_sfc: try: h = ossim.height(point[1], point[0]) floor = h[1] except: ## most probably: no gound info :'( floor = 0 else: print "unexpected floor spec for", airspace return (ceil,floor)
def get_ceiling_floor_at_point(airspace, point): ceil, floor = None, None if airspace.ceil_fl != -1: ceil = airspace.ceil_fl * 100 * 0.3048 elif airspace.ceil_ref and airspace.ceil_ref == 'AGL': try: h = ossim.height(point[1], point[0]) ceil = airspace.ceil_alti_m + h[1] except: ## most probably: no ground info :( ceil = 0 elif airspace.ceil_ref and airspace.ceil_ref == 'AMSL': ceil = airspace.ceil_alti_m elif airspace.ceil_unl: ceil = 100000 else: print "unexpected ceil spec for", airspace if airspace.flr_fl != -1: floor = airspace.flr_fl * 100 * 0.3048 elif airspace.flr_ref and airspace.flr_ref == 'AGL': try: h = ossim.height(point[1], point[0]) floor = airspace.flr_alti_m + h[1] except: ## most probably: no ground info :( floor = 0 elif airspace.flr_ref and airspace.flr_ref == 'AMSL': floor = airspace.flr_alti_m elif airspace.flr_f_sfc: try: h = ossim.height(point[1], point[0]) floor = h[1] except: ## most probably: no gound info :'( floor = 0 else: print "unexpected floor spec for", airspace return (ceil, floor)
def get_relief_profile_along_track(track): """ track should be a list of coord. """ relief_profile = [] for p in track: h = ossim.height(p[1], p[0]) ## if data not available, default to 0 if h: relief_profile.append(h[1]) else: relief_profile.append(0) return relief_profile
def getGroundLevelAt(self, lat, lon): r = ossim.height(lat,lon) if r: return r[0] else: return None