本文整理汇总了Python中model.Point.latitude方法的典型用法代码示例。如果您正苦于以下问题:Python Point.latitude方法的具体用法?Python Point.latitude怎么用?Python Point.latitude使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类model.Point
的用法示例。
在下文中一共展示了Point.latitude方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parse
# 需要导入模块: from model import Point [as 别名]
# 或者: from model.Point import latitude [as 别名]
def parse(filename,filepointer):
rows = filepointer.readlines()
airspaceFile = AirspaceFile(name=filename, importDate=datetime.now())
counter = 0
previousLine = ''
for line in rows:
#logger.debug(line)
identifier = line[:2]
bareline = line[3:].replace('\r\n','')
if(re.match("^[A-Za-z]",identifier)):
if identifier == 'AC':
airspace = Airspace(type=AIRSPACE_CLASSES[bareline],description=previousLine[14:].replace('\r\n',''))
airspaceFile.airspaces.append(airspace)
counter = 0
elif identifier == 'AN':
if bareline.startswith('BERGBAHN'):
airspace.subtype = 'CABLECAR'
airspace.name = bareline[9:]
elif bareline.startswith('KABEL'):
airspace.subtype = 'CABLE'
airspace.name = bareline[6:]
elif bareline.startswith('SCHUTZ'):
airspace.subtype = 'WILDLIFE_PROTECTION'
airspace.name = bareline[7:]
else:
airspace.name = bareline
elif identifier == 'AH':
#airspace.ceiling = int(bareline.replace('GND', '0').replace('ft', '').strip())
airspace.ceiling = bareline
elif identifier == 'AL':
#airspace.floor = int(bareline.replace('GND', '0').replace('ft', '').strip())
airspace.floor = bareline
elif identifier == 'DP':
point = Point(index=counter)
point.latitude = bareline[:8]
point.latitude_dec = dms2dec(point.latitude[:2],point.latitude[3:5],point.latitude[6:])
point.longitude = bareline[11:20]
point.longitude_dec = dms2dec(point.longitude[:3],point.longitude[4:6],point.longitude[7:])
airspace.points.append(point)
counter += 1
previousLine = line
return airspaceFile