WSF
usmtf::UTM_Location Class Reference

FFIRN_Validator responsible for the validation and property extraction of a UTM Location. More...

#include <UTM_Location.hpp>

Inheritance diagram for usmtf::UTM_Location:
Collaboration diagram for usmtf::UTM_Location:

Public Member Functions

 UTM_Location ()
bool ParseAndValidate (const Field &aField) override
const std::string & GetZoneColumn () const noexcept
const std::string & GetZoneRow () const noexcept
const std::string & GetSquareColumn () const noexcept
const std::string & GetSquareRow () const noexcept
const std::string & GetEasting () const noexcept
const std::string & GetNorthing () const noexcept
int GetEastingInMeters () const noexcept
int GetNorthingInMeters () const noexcept
const std::string GetFormattedLocation () const noexcept
Public Member Functions inherited from usmtf::RegexValidator
 RegexValidator ()=default
void SetRegexExpression (const std::string &aExpression)
 Configure to run against regex needs.
void SetErrorMessage (const std::string &aMessage)
Public Member Functions inherited from usmtf::FFIRN_Validator
 FFIRN_Validator ()=default
const std::string & GetRawContent () const noexcept
 Return the content of the field as it was in the USMTF set.
std::vector< std::string > SplitOnDelimeter (const std::string &value, const std::string &delimeter)
 Values separated by delimeter.
const std::string & GetFieldContent () const noexcept
Public Member Functions inherited from usmtf::Validatable
bool IsValid () const noexcept
Public Member Functions inherited from usmtf::ErrorManager
virtual ~ErrorManager ()=default
bool HasErrors () const noexcept
void LogErrors (std::ostream &aOut) const noexcept
const std::vector< ValidationError > & GetErrors () const

Protected Member Functions

UtLLPos ConvertToLLPos () const noexcept
Protected Member Functions inherited from usmtf::FFIRN_Validator
bool ValidateByDescriptor (const FFIRN_DescriptorMap &aDescriptorMap)
 Speed up validation if descriptor is present. Runs all functions if it isn't.
void ClearErrorsIfValid (bool aHasAtLeastOnePassed) noexcept
void SetField (const Field &aField) noexcept
 Field Setter for internal use only.
Protected Member Functions inherited from usmtf::ErrorManager
void AddError (const ValidationError &aError) noexcept
void AddError (const std::string &aFailureReason, const std::string &aValueValidatied, const std::string &aOptionalSuggestion="") noexcept
void AddError (const std::string &aErrorMessage) noexcept
void AddErrors (const std::vector< ValidationError > &aErrors) noexcept
void ClearErrors () noexcept

Protected Attributes

std::string mZoneColumn
std::string mZoneRow
std::string mSquareColumn
std::string mSquareRow
std::string mEasting
std::string mNorthing
Protected Attributes inherited from usmtf::RegexValidator
QRegularExpressionMatch mMatchResults
QRegularExpression mRegexExpression
std::string mRegexString {"No Regex Provided"}
std::string mErrorMessage {"Failed Regex Validation for: " + mRegexString}
Protected Attributes inherited from usmtf::FFIRN_Validator
Field mField

Additional Inherited Members

Public Types inherited from usmtf::FFIRN_Validator
using FFIRN_Func = std::function<bool(void)>
using FFIRN_DescriptorMap = std::unordered_map<std::string, FFIRN_Func>
Static Public Member Functions inherited from usmtf::FFIRN_Validator
static bool IsInSelection (const std::string &aValue, const std::vector< std::string > &choices) noexcept
static bool IsStringLength (const std::string &aValue, size_t aLength) noexcept
static size_t CheckForAnyDelimeter (const std::string &aValue, const std::vector< std::string > &aDelimeters) noexcept
 Returns the positions of a specified delimiter if present, npos if not.
static size_t CheckForAnyDelimeter (const std::string &aValue, const std::vector< std::string > &aDelimeters, std::string &aFoundDelimeter) noexcept
template<class T>
static bool IsInRange (T aValue, T aLowerBound, T aUpperBound) noexcept
Static Public Attributes inherited from usmtf::RegexValidator
static const std::string cAny = R"((.*))"
static const std::string c00to90 = R"(([0-8][0-9]|90))"
static const std::string c00to59 = R"(([0-5][0-9]))"
static const std::string c00to59dec000to999 = R"(([0-5][0-9])(.)([0-9]{3}))"
static const std::string c00to59dec0to9 = R"(([0-5][0-9])(.)([0-9]{1}))"
static const std::string c01to60 = R"(([0-5][1-9]|10|20|30|40|50|60))"
static const std::string cNorS = R"((N|S))"
static const std::string cAtoZ = R"((A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z))"
static const std::string c0to9 = R"(([0-9]))"
static const std::string cHyphenDelimeter = R"((-))"
static const std::string c000to180 = R"((0[0-9]{2}|1[0-7][0-9]|180))"
static const std::string c000to359 = R"((0[0-9]{2}|1[0-9]{2}|2[0-9]{2}|3[0-5][0-9]))"
static const std::string c0to999 = R"(([0-9]{1,3}))"
static const std::string c1to999 = R"(([1-9][0-9]{0,2}))"
static const std::string c000to99999 = R"(([0-9]{3,5}))"
static const std::string cEorW = R"((E|W))"
static const std::string cStart = R"(^)"
static const std::string cEnd = R"($)"
static const std::string cSpace = R"( )"

Detailed Description

FFIRN_Validator responsible for the validation and property extraction of a UTM Location.

Table TABLE 330,12,542 LOCATION, MGRS 1-METER, 10-METER, 100-METER 330.UF.html

UTM (Universal Transverse Mercator) coordinate system is basically geographical latitude longitude system that is expressed in two-dimensional projection of the surface of earth where the earth map is divided into 60 zones, with each of them separated by 6 degrees in longitude and the locations are expressed in terms of so called easting and northing, i.e. Easting 380749.6, Northing 4928286.8 This system is most commonly used for military purposes.

Easting: the x coordinate Northing: the y coordinate

EXPRESSED AS FOLLOWS:

UTM GRID ZONE COLUMN 2 N

ALLOWABLE ENTRIES: (01 THROUGH 60).

UTM GRID ZONE ROW 1 A

ALLOWABLE ENTRIES: (C, D THROUGH X) [OMIT I, O]. NEITHER I NOR O OCCURS.

100,000-METER SQUARE COLUMN 1 A

ALLOWABLE ENTRIES: (A, B THROUGH Z) [OMIT I, O].

100,000-METER SQUARE ROW 1 A

ALLOWABLE ENTRIES: (A, B THROUGH V) [OMIT I, O].

UTM 1-METER EASTING 5 N

ALLOWABLE ENTRIES: (00000 THROUGH 99999).

UTM 1-METER NORTHING 5 N

ALLOWABLE ENTRIES: (00000 THROUGH 99999).

EXAMPLE: /18RTV2345678921

USMTF Excerpt: /UTMT:32WDL12341234 /UTMO:32WDL123123 /UTM:32WDL1234512345

Constructor & Destructor Documentation

◆ UTM_Location()

Member Function Documentation

◆ ConvertToLLPos()

UtLLPos usmtf::UTM_Location::ConvertToLLPos ( ) const
protectednoexcept

◆ GetEasting()

const std::string & usmtf::UTM_Location::GetEasting ( ) const
noexcept

References mEasting.

◆ GetEastingInMeters()

int usmtf::UTM_Location::GetEastingInMeters ( ) const
noexcept

References mEasting.

◆ GetFormattedLocation()

const std::string usmtf::UTM_Location::GetFormattedLocation ( ) const
noexcept

◆ GetNorthing()

const std::string & usmtf::UTM_Location::GetNorthing ( ) const
noexcept

References mNorthing.

◆ GetNorthingInMeters()

int usmtf::UTM_Location::GetNorthingInMeters ( ) const
noexcept

References mEasting, and mNorthing.

◆ GetSquareColumn()

const std::string & usmtf::UTM_Location::GetSquareColumn ( ) const
noexcept

References mSquareColumn.

◆ GetSquareRow()

const std::string & usmtf::UTM_Location::GetSquareRow ( ) const
noexcept

References mSquareRow.

◆ GetZoneColumn()

const std::string & usmtf::UTM_Location::GetZoneColumn ( ) const
noexcept

References mZoneColumn.

◆ GetZoneRow()

const std::string & usmtf::UTM_Location::GetZoneRow ( ) const
noexcept

References mZoneRow.

◆ ParseAndValidate()

bool usmtf::UTM_Location::ParseAndValidate ( const Field & aField)
overridevirtual

Run against whole field content. If Matches, safely extract portions. I see this be used in conjunction with variant validator quite a bit to solve complex extraction. Lets see!!

Reimplemented from usmtf::RegexValidator.

References mEasting, usmtf::RegexValidator::mMatchResults, mNorthing, mSquareColumn, mSquareRow, mZoneColumn, mZoneRow, and usmtf::RegexValidator::ParseAndValidate().

Member Data Documentation

◆ mEasting

std::string usmtf::UTM_Location::mEasting
protected

◆ mNorthing

std::string usmtf::UTM_Location::mNorthing
protected

◆ mSquareColumn

std::string usmtf::UTM_Location::mSquareColumn
protected

◆ mSquareRow

std::string usmtf::UTM_Location::mSquareRow
protected

Referenced by GetSquareRow(), and ParseAndValidate().

◆ mZoneColumn

std::string usmtf::UTM_Location::mZoneColumn
protected

Referenced by GetZoneColumn(), and ParseAndValidate().

◆ mZoneRow

std::string usmtf::UTM_Location::mZoneRow
protected

Referenced by GetZoneRow(), and ParseAndValidate().


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved