/// <inheritdoc/> public LLH[] NEEToLLH(string csib, NEE[] coordinates, ReturnAs returnAs = ReturnAs.Radians) { var requestId = Guid.NewGuid(); if (_log.IsTraceEnabled()) { _log.LogTrace($"{nameof(NEEToLLH)}: CoreXRequestID: {requestId}, NEE[]: {string.Concat(coordinates)}, ReturnAs: {returnAs}, CSIB: {csib}"); } var llhCoords = _coreX .TransformNEEToLLH(csib, coordinates, fromType: CoordinateTypes.OrientatedNEE, toType: CoordinateTypes.ReferenceGlobalLLH); var responseArray = new LLH[llhCoords.Length]; var inDegrees = returnAs == ReturnAs.Degrees; for (var i = 0; i < llhCoords.Length; i++) { var llh = llhCoords[i]; responseArray[i] = new LLH { Longitude = inDegrees ? llh.Longitude.RadiansToDegrees() : llh.Longitude, Latitude = inDegrees ? llh.Latitude.RadiansToDegrees() : llh.Latitude, Height = llh.Height }; } if (_log.IsTraceEnabled()) { _log.LogTrace($"{nameof(NEEToLLH)}: CoreXRequestID: {requestId}, Returning LLH[]: {string.Concat(responseArray)}"); } return(responseArray); }
/// <inheritdoc/> public LLH NEEToLLH(string csib, NEE coordinates, ReturnAs returnAs = ReturnAs.Radians) { var requestId = Guid.NewGuid(); if (_log.IsTraceEnabled()) { _log.LogTrace($"{nameof(NEEToLLH)}: CoreXRequestID: {requestId}, NEE: {coordinates}, ReturnAs: {returnAs}, CSIB: {csib}"); } var llhCoords = _coreX .TransformNEEToLLH(csib, coordinates, fromType: CoordinateTypes.OrientatedNEE, toType: CoordinateTypes.ReferenceGlobalLLH); var inDegrees = returnAs == ReturnAs.Degrees; var result = new LLH { Longitude = inDegrees ? llhCoords.Longitude.RadiansToDegrees() : llhCoords.Longitude, Latitude = inDegrees ? llhCoords.Latitude.RadiansToDegrees() : llhCoords.Latitude, Height = llhCoords.Height }; if (_log.IsTraceEnabled()) { _log.LogTrace($"{nameof(NEEToLLH)}: CoreXRequestID: {requestId}, Returning LLH: {result}"); } return(result); }
public SelectSegment(int indentCount, string methodName, Sql sql, string statement, string assignTo, List <Parameter> parameters, ReturnAs returnAs = ReturnAs.Array) : base(indentCount) { Requires.Add("var Request = require('tedious').Request;"); DependsOnSegments.Add(new ConnectionSegement(indentCount, sql)); DependsOnModules.Add("\"tedious\": \"5.0.3\""); Methods.Add(selectMethod .Replace("#method-name", methodName) .Replace("#sql", statement) .Replace("#database", sql.DbName) .Replace("#scalar", (returnAs == ReturnAs.Scalar).ToLowerString()) .Replace("#entity", (returnAs == ReturnAs.Entity).ToLowerString()) .Replace("#parameters", string.Join(',', parameters.Select(p => p.Name.Replace("@", "")))) .Replace("#add-params", Helper.CreateParameters(parameters)));; FunctionCode = $"var {assignTo} = await {methodName}({string.Join(',', parameters.Select(p => p.Value)).Trim()});"; }
public void Should_see_Height_values_differ_when_comparing_CS_files_with_VERT_ADJUST(double lat, double lon, double height, ReturnAs returnAs, string dcFilename) { var csib = GetCSIBFromDC(dcFilename); var xyz = _convertCoordinates.NEEToLLH(csib, new XYZ(2313, 1204, 609), returnAs); xyz.Should().NotBeNull(); xyz.X.Should().BeApproximately(lon, LL_CM_TOLERANCE); xyz.Y.Should().BeApproximately(lat, LL_CM_TOLERANCE); xyz.Z.Should().BeApproximately(height, LL_CM_TOLERANCE); }
public void CoordinateService_SimpleNEEToLLH(double lat, double lon, double height, ReturnAs returnAs) { var llhCoords = _convertCoordinates.NEEToLLH(_csib, new NEE { North = 1204, East = 2313, Elevation = 609 }, returnAs); llhCoords.Should().NotBeNull(); llhCoords.Latitude.Should().BeApproximately(lat, LL_CM_TOLERANCE); llhCoords.Longitude.Should().BeApproximately(lon, LL_CM_TOLERANCE); llhCoords.Height.Should().BeApproximately(height, LL_CM_TOLERANCE); }
public void CoordinateService_SimpleXYZToLLH(double northing, double easting, double elevation, double lat, double lon, double height, ReturnAs returnAs, string csib) { var llhCoords = _convertCoordinates.NEEToLLH(csib, new XYZ { X = easting, Y = northing, Z = elevation }, returnAs); llhCoords.Should().NotBeNull(); llhCoords.Y.Should().BeApproximately(lat, LL_CM_TOLERANCE); llhCoords.X.Should().BeApproximately(lon, LL_CM_TOLERANCE); llhCoords.Z.Should().BeApproximately(height, LL_CM_TOLERANCE); }
public void CoordinateService_SimpleXYZNEEToLLH(double lat, double lon, double height, ReturnAs returnAs) { var xyz = _convertCoordinates.NEEToLLH(_csib, new XYZ(2313, 1204, 609), returnAs); xyz.Should().NotBeNull(); xyz.X.Should().BeApproximately(lon, LL_CM_TOLERANCE); xyz.Y.Should().BeApproximately(lat, LL_CM_TOLERANCE); xyz.Z.Should().BeApproximately(height, LL_CM_TOLERANCE); }