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


Python ExportBuilder.split_gps_components方法代码示例

本文整理汇总了Python中onadata.libs.utils.export_tools.ExportBuilder.split_gps_components方法的典型用法代码示例。如果您正苦于以下问题:Python ExportBuilder.split_gps_components方法的具体用法?Python ExportBuilder.split_gps_components怎么用?Python ExportBuilder.split_gps_components使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在onadata.libs.utils.export_tools.ExportBuilder的用法示例。


在下文中一共展示了ExportBuilder.split_gps_components方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_split_gps_components_works_when_gps_data_is_blank

# 需要导入模块: from onadata.libs.utils.export_tools import ExportBuilder [as 别名]
# 或者: from onadata.libs.utils.export_tools.ExportBuilder import split_gps_components [as 别名]
 def test_split_gps_components_works_when_gps_data_is_blank(self):
     gps_fields = {
         "geo/geolocation": [
             "geo/_geolocation_latitude",
             "geo/_geolocation_longitude",
             "geo/_geolocation_altitude",
             "geo/_geolocation_precision",
         ]
     }
     row = {"geo/geolocation": ""}
     new_row = ExportBuilder.split_gps_components(row, gps_fields)
     expected_row = {"geo/geolocation": ""}
     self.assertEqual(new_row, expected_row)
开发者ID:CharaD7,项目名称:kobocat,代码行数:15,代码来源:test_export_builder.py

示例2: test_split_gps_components_works

# 需要导入模块: from onadata.libs.utils.export_tools import ExportBuilder [as 别名]
# 或者: from onadata.libs.utils.export_tools.ExportBuilder import split_gps_components [as 别名]
 def test_split_gps_components_works(self):
     gps_fields = {
         "geo/geolocation": [
             "geo/_geolocation_latitude",
             "geo/_geolocation_longitude",
             "geo/_geolocation_altitude",
             "geo/_geolocation_precision",
         ]
     }
     row = {"geo/geolocation": "1.0 36.1 2000 20"}
     new_row = ExportBuilder.split_gps_components(row, gps_fields)
     expected_row = {
         "geo/geolocation": "1.0 36.1 2000 20",
         "geo/_geolocation_latitude": "1.0",
         "geo/_geolocation_longitude": "36.1",
         "geo/_geolocation_altitude": "2000",
         "geo/_geolocation_precision": "20",
     }
     self.assertEqual(new_row, expected_row)
开发者ID:CharaD7,项目名称:kobocat,代码行数:21,代码来源:test_export_builder.py

示例3: test_split_gps_components_works_when_gps_data_is_blank

# 需要导入模块: from onadata.libs.utils.export_tools import ExportBuilder [as 别名]
# 或者: from onadata.libs.utils.export_tools.ExportBuilder import split_gps_components [as 别名]
 def test_split_gps_components_works_when_gps_data_is_blank(self):
     gps_fields =\
         {
             'geo/geolocation':
             [
                 'geo/_geolocation_latitude', 'geo/_geolocation_longitude',
                 'geo/_geolocation_altitude', 'geo/_geolocation_precision'
             ]
         }
     row = \
         {
             'geo/geolocation': '',
         }
     new_row = ExportBuilder.split_gps_components(
         row, gps_fields)
     expected_row = \
         {
             'geo/geolocation': '',
         }
     self.assertEqual(new_row, expected_row)
开发者ID:199212151746,项目名称:onadata,代码行数:22,代码来源:test_export_builder.py

示例4: test_split_gps_components_works

# 需要导入模块: from onadata.libs.utils.export_tools import ExportBuilder [as 别名]
# 或者: from onadata.libs.utils.export_tools.ExportBuilder import split_gps_components [as 别名]
 def test_split_gps_components_works(self):
     gps_fields =\
         {
             'geo/geolocation':
             [
                 'geo/_geolocation_latitude', 'geo/_geolocation_longitude',
                 'geo/_geolocation_altitude', 'geo/_geolocation_precision'
             ]
         }
     row = \
         {
             'geo/geolocation': '1.0 36.1 2000 20',
         }
     new_row = ExportBuilder.split_gps_components(
         row, gps_fields)
     expected_row = \
         {
             'geo/geolocation': '1.0 36.1 2000 20',
             'geo/_geolocation_latitude': '1.0',
             'geo/_geolocation_longitude': '36.1',
             'geo/_geolocation_altitude': '2000',
             'geo/_geolocation_precision': '20'
         }
     self.assertEqual(new_row, expected_row)
开发者ID:199212151746,项目名称:onadata,代码行数:26,代码来源:test_export_builder.py


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