From ca6adffc25aefdd66e7b0459b8d0b542e2df7bdf Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Wed, 9 Sep 2020 14:21:10 +1000 Subject: [PATCH] Fix incorrect auditing of geolocation MicroMVD in BIMTester --- src/ifcbimtester/features/steps/geolocation.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ifcbimtester/features/steps/geolocation.py b/src/ifcbimtester/features/steps/geolocation.py index b15e902d6d..0c243749c0 100644 --- a/src/ifcbimtester/features/steps/geolocation.py +++ b/src/ifcbimtester/features/steps/geolocation.py @@ -3,6 +3,7 @@ from utils import IfcFile, assert_number, assert_pset, assert_attribute import math import ifcopenshell.util import ifcopenshell.util.element +import ifcopenshell.util.geolocation @step(u'There must be at least one {ifc_class} element') def step_impl(context, ifc_class): @@ -161,8 +162,7 @@ def step_impl(context, number): return check_ifc2x3_geolocation('EPset_MapConversion', 'Height', number) abscissa = check_ifc4_geolocation('IfcMapConversion', 'XAxisAbscissa', should_assert=False) ordinate = check_ifc4_geolocation('IfcMapConversion', 'XAxisOrdinate', should_assert=False) - # TODO: migrate to geolocation util - actual_value = round(math.degrees(math.atan2(ordinate, abscissa)) - 90, 3) + actual_value = round(ifcopenshell.util.geolocation.xy2angle(abscissa, ordinate) * -1, 3) value = round(number, 3) assert actual_value == value, 'We expected a value of "{}" but instead got "{}"'.format(value, actual_value) @@ -183,6 +183,7 @@ def step_impl(context, guid, number): site = IfcFile.by_guid(guid) if not site.is_a('IfcSite'): assert False, 'The element {} is not an IfcSite'.format(site) + number = ifcopenshell.util.geolocation.dd2dms(number) assert_attribute(site, 'RefLongitude', number) @@ -192,6 +193,7 @@ def step_impl(context, guid, number): site = IfcFile.by_guid(guid) if not site.is_a('IfcSite'): assert False, 'The element {} is not an IfcSite'.format(site) + number = ifcopenshell.util.geolocation.dd2dms(number) assert_attribute(site, 'RefLatitude', number)