本文整理汇总了Python中auvsi_suas.models.uas_telemetry.UasTelemetry.kml方法的典型用法代码示例。如果您正苦于以下问题:Python UasTelemetry.kml方法的具体用法?Python UasTelemetry.kml怎么用?Python UasTelemetry.kml使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类auvsi_suas.models.uas_telemetry.UasTelemetry
的用法示例。
在下文中一共展示了UasTelemetry.kml方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_kml_simple
# 需要导入模块: from auvsi_suas.models.uas_telemetry import UasTelemetry [as 别名]
# 或者: from auvsi_suas.models.uas_telemetry.UasTelemetry import kml [as 别名]
def test_kml_simple(self):
coordinates = [
(-76.0, 38.0, 0.0),
(-76.0, 38.0, 10.0),
(-76.0, 38.0, 20.0),
(-76.0, 38.0, 30.0),
(-76.0, 38.0, 100.0),
(-76.0, 38.0, 30.0),
(-76.0, 38.0, 60.0),
]
# Create Coordinates
start = TakeoffOrLandingEvent(user=self.user, uas_in_air=True)
start.save()
for coord in coordinates:
self.create_log_element(*coord)
end = TakeoffOrLandingEvent(user=self.user, uas_in_air=False)
end.save()
kml = Kml()
UasTelemetry.kml(user=self.user,
logs=UasTelemetry.by_user(self.user),
kml=kml,
kml_doc=kml)
for coord in coordinates:
tag = self.coord_format.format(coord[1], coord[0],
units.feet_to_meters(coord[2]))
self.assertTrue(tag in kml.kml())
示例2: get
# 需要导入模块: from auvsi_suas.models.uas_telemetry import UasTelemetry [as 别名]
# 或者: from auvsi_suas.models.uas_telemetry.UasTelemetry import kml [as 别名]
def get(self, request):
kml = Kml(name='AUVSI SUAS Flight Data')
kml_teams = kml.newfolder(name='Teams')
kml_mission = kml.newfolder(name='Missions')
users = User.objects.all()
for user in users:
# Ignore admins
if user.is_superuser:
continue
UasTelemetry.kml(user=user,
logs=UasTelemetry.by_user(user),
kml=kml_teams,
kml_doc=kml.document)
MissionConfig.kml_all(kml_mission)
kml_flyzone = kml.newfolder(name='Fly Zones')
FlyZone.kml_all(kml_flyzone)
response = HttpResponse(kml.kml())
response['Content-Type'] = 'application/vnd.google-earth.kml+xml'
response['Content-Disposition'] = 'attachment; filename=mission.kml'
response['Content-Length'] = str(len(response.content))
return response
示例3: test_kml_empty
# 需要导入模块: from auvsi_suas.models.uas_telemetry import UasTelemetry [as 别名]
# 或者: from auvsi_suas.models.uas_telemetry.UasTelemetry import kml [as 别名]
def test_kml_empty(self):
kml = Kml()
UasTelemetry.kml(user=self.user,
logs=UasTelemetry.by_user(self.user),
kml=kml,
kml_doc=kml)