private bool IsPoint(RockfallReportTyped typedRow) { if (typedRow.SpatialData == SpatialData.Gps) { //not necessary because they are mandatory if (typedRow.EndLongitude == null || typedRow.EndLatitude == null) { return(true); } if (typedRow.StartLongitude == typedRow.EndLongitude && typedRow.StartLatitude == typedRow.EndLatitude) { return(true); } } else { //not necessary because they are mandatory if (typedRow.EndOffset == null) { return(true); } if (typedRow.StartOffset == typedRow.EndOffset) { return(true); } } return(false); }
private async Task <RockfallReportGeometry> PerformSpatialValidationAndConversionAsync(RockfallReportTyped typedRow) { var submissionRow = _submissionRows[(decimal)typedRow.RowNum]; var rockfallReport = new RockfallReportGeometry(typedRow, null); if (typedRow.SpatialData == SpatialData.Gps) { await PerformSpatialGpsValidation(rockfallReport, submissionRow); SetVarianceWarningDetail(submissionRow, typedRow.HighwayUnique, GetGpsString(typedRow.StartLatitude, typedRow.StartLongitude), GetGpsString(typedRow.EndLatitude, typedRow.EndLongitude), _thresholdSpLevel); } else if (typedRow.SpatialData == SpatialData.Lrs) { await PerformSpatialLrsValidation(rockfallReport, submissionRow); SetVarianceWarningDetail(submissionRow, typedRow.HighwayUnique, GetOffsetString(typedRow.StartOffset), GetOffsetString(typedRow.EndOffset), _thresholdSpLevel); } return(rockfallReport); }