本文整理匯總了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