本文整理汇总了Python中pyon.public.IonObject.geospatial_longitude_limit_east方法的典型用法代码示例。如果您正苦于以下问题:Python IonObject.geospatial_longitude_limit_east方法的具体用法?Python IonObject.geospatial_longitude_limit_east怎么用?Python IonObject.geospatial_longitude_limit_east使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyon.public.IonObject
的用法示例。
在下文中一共展示了IonObject.geospatial_longitude_limit_east方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _do_test_create_geospatial_point_center
# 需要导入模块: from pyon.public import IonObject [as 别名]
# 或者: from pyon.public.IonObject import geospatial_longitude_limit_east [as 别名]
def _do_test_create_geospatial_point_center(self, resources):
platformsite_obj = IonObject(RT.PlatformSite,
name='TestPlatformSite',
description='some new TestPlatformSite')
geo_index_obj = IonObject(OT.GeospatialBounds)
geo_index_obj.geospatial_latitude_limit_north = 20.0
geo_index_obj.geospatial_latitude_limit_south = 10.0
geo_index_obj.geospatial_longitude_limit_east = 15.0
geo_index_obj.geospatial_longitude_limit_west = 20.0
platformsite_obj.constraint_list = [geo_index_obj]
platformsite_id = self.OMS.create_platform_site(platformsite_obj)
# now get the dp back to see if it was updated
platformsite_obj = self.OMS.read_platform_site(platformsite_id)
self.assertEquals('some new TestPlatformSite', platformsite_obj.description)
self.assertAlmostEqual(15.0, platformsite_obj.geospatial_point_center.lat, places=1)
#now adjust a few params
platformsite_obj.description = 'some old TestPlatformSite'
geo_index_obj = IonObject(OT.GeospatialBounds)
geo_index_obj.geospatial_latitude_limit_north = 30.0
geo_index_obj.geospatial_latitude_limit_south = 20.0
platformsite_obj.constraint_list = [geo_index_obj]
update_result = self.OMS.update_platform_site(platformsite_obj)
# now get the dp back to see if it was updated
platformsite_obj = self.OMS.read_platform_site(platformsite_id)
self.assertEquals('some old TestPlatformSite', platformsite_obj.description)
self.assertAlmostEqual(25.0, platformsite_obj.geospatial_point_center.lat, places=1)
self.OMS.force_delete_platform_site(platformsite_id)
示例2: test_midpoint
# 需要导入模块: from pyon.public import IonObject [as 别名]
# 或者: from pyon.public.IonObject import geospatial_longitude_limit_east [as 别名]
def test_midpoint(self):
geospatial_bounds = IonObject("GeospatialBounds")
geospatial_bounds.geospatial_latitude_limit_north = 10
geospatial_bounds.geospatial_latitude_limit_south = -10
geospatial_bounds.geospatial_longitude_limit_east = 10
geospatial_bounds.geospatial_longitude_limit_west = -10
# Basic test
#TODO. do we really want calc_geospatial_point_center() to return string?
mid_point = GeoUtils.calc_geospatial_point_center(geospatial_bounds)
self.assertAlmostEqual(mid_point.lat, 0.0)
self.assertAlmostEqual(mid_point.lon, 0.0)
mid_point = GeoUtils.calc_geospatial_point_center(geospatial_bounds, distance=GeoUtils.DISTANCE_SHORTEST)
self.assertAlmostEqual(mid_point.lat, 0.0)
self.assertAlmostEqual(mid_point.lon, 0.0)
mid_point = GeoUtils.calc_geospatial_point_center(geospatial_bounds, distance=GeoUtils.DISTANCE_LONGEST)
self.assertAlmostEqual(mid_point.lat, 0.0)
self.assertAlmostEqual(mid_point.lon, -180)
geospatial_bounds.geospatial_latitude_limit_north = 10
geospatial_bounds.geospatial_latitude_limit_south = -10
geospatial_bounds.geospatial_longitude_limit_east = 179
geospatial_bounds.geospatial_longitude_limit_west = -179
mid_point = GeoUtils.calc_geospatial_point_center(geospatial_bounds)
self.assertAlmostEqual(mid_point.lat, 0.0)
self.assertAlmostEqual(mid_point.lon, 0.0)
mid_point = GeoUtils.calc_geospatial_point_center(geospatial_bounds, distance=GeoUtils.DISTANCE_SHORTEST)
self.assertAlmostEqual(mid_point.lat, 0.0)
self.assertAlmostEqual(mid_point.lon, -180.0)
mid_point = GeoUtils.calc_geospatial_point_center(geospatial_bounds, distance=GeoUtils.DISTANCE_LONGEST)
self.assertAlmostEqual(mid_point.lat, 0.0)
self.assertAlmostEqual(mid_point.lon, 0.0)
geospatial_bounds.geospatial_longitude_limit_east = -179
geospatial_bounds.geospatial_longitude_limit_west = 179
mid_point = GeoUtils.calc_geospatial_point_center(geospatial_bounds)
self.assertAlmostEqual(mid_point.lon, -180.0)
geospatial_bounds.geospatial_latitude_limit_north = 90
geospatial_bounds.geospatial_latitude_limit_south = -90
geospatial_bounds.geospatial_longitude_limit_east = 0
geospatial_bounds.geospatial_longitude_limit_west = 0
mid_point = GeoUtils.calc_geospatial_point_center(geospatial_bounds)
self.assertAlmostEqual(mid_point.lat, 0.0)
self.assertAlmostEqual(mid_point.lon, 0.0)
# MM: changed this: if the same values are given, we expect a point not the full globe
#self.assertAlmostEqual(mid_point.lon, -180.0)
geospatial_bounds.geospatial_latitude_limit_north = 40
geospatial_bounds.geospatial_latitude_limit_south = 50
geospatial_bounds.geospatial_longitude_limit_east = -75
geospatial_bounds.geospatial_longitude_limit_west = -125
mid_point = GeoUtils.calc_geospatial_point_center(geospatial_bounds)
self.assertAlmostEqual(mid_point.lat, 47.801397, 6)
self.assertAlmostEqual(mid_point.lon, -102.328727, 6)
mid_point = GeoUtils.calc_geospatial_point_center(geospatial_bounds, distance=GeoUtils.DISTANCE_SHORTEST)
self.assertAlmostEqual(mid_point.lat, 47.801397, 6)
self.assertAlmostEqual(mid_point.lon, -102.328727, 6)
mid_point = GeoUtils.calc_geospatial_point_center(geospatial_bounds, distance=GeoUtils.DISTANCE_LONGEST)
self.assertAlmostEqual(mid_point.lat, 47.801397, 6)
self.assertAlmostEqual(mid_point.lon, 77.671273, 6)
geospatial_bounds.geospatial_longitude_limit_west = 165
geospatial_bounds.geospatial_latitude_limit_north = 5
geospatial_bounds.geospatial_longitude_limit_east = -170
geospatial_bounds.geospatial_latitude_limit_south = 5
mid_point = GeoUtils.calc_geospatial_point_center(geospatial_bounds)
self.assertAlmostEqual(mid_point.lat, 5.121583, 6)
self.assertAlmostEqual(mid_point.lon, 177.5, 6)
geospatial_bounds.geospatial_longitude_limit_west = 65
geospatial_bounds.geospatial_latitude_limit_north = 0
geospatial_bounds.geospatial_longitude_limit_east = 165
geospatial_bounds.geospatial_latitude_limit_south = 0
mid_point = GeoUtils.calc_geospatial_point_center(geospatial_bounds)
self.assertAlmostEqual(mid_point.lat, 0.0, 6)
self.assertAlmostEqual(mid_point.lon, 115.0, 6)
geospatial_bounds.geospatial_longitude_limit_west = 10.0
geospatial_bounds.geospatial_latitude_limit_north = 0
geospatial_bounds.geospatial_longitude_limit_east = -150
geospatial_bounds.geospatial_latitude_limit_south = 0
mid_point = GeoUtils.calc_geospatial_point_center(geospatial_bounds)
self.assertAlmostEqual(mid_point.lat, 0.0, 6)
self.assertAlmostEqual(mid_point.lon, 110.0, 6)
geospatial_bounds.geospatial_longitude_limit_west = -150
geospatial_bounds.geospatial_latitude_limit_north = 0
geospatial_bounds.geospatial_longitude_limit_east = 170
geospatial_bounds.geospatial_latitude_limit_south = 0
mid_point = GeoUtils.calc_geospatial_point_center(geospatial_bounds)
self.assertAlmostEqual(mid_point.lat, 0.0, 6)
self.assertAlmostEqual(mid_point.lon, 10.0, 6)
geospatial_bounds.geospatial_longitude_limit_west = 30
#.........这里部分代码省略.........