当前位置: 首页>>代码示例>>Python>>正文


Python UasTelemetry.kml方法代码示例

本文整理汇总了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())
开发者ID:legonigel,项目名称:interop,代码行数:29,代码来源:uas_telemetry_test.py

示例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
开发者ID:auvsi-suas,项目名称:interop,代码行数:24,代码来源:export_kml.py

示例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)
开发者ID:legonigel,项目名称:interop,代码行数:8,代码来源:uas_telemetry_test.py


注:本文中的auvsi_suas.models.uas_telemetry.UasTelemetry.kml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。