LuciadCPillar 2023.1.04
luciad::MgrsFormat::Builder Class Referencefinal

Builder for creating luciad::MgrsFormat. More...

#include <luciad/grids/mgrs/MgrsFormat.h>

Public Member Functions

 Builder (const Builder &other)
 
 ~Builder ()
 
MgrsFormat build () const
 Creates the MGRS format, based on the properties set on this builder. More...
 
BuildercoordinateSeparator (std::string coordinateSeparator)
 Sets the string to separate the zone/grid letters and the coordinates. More...
 
BuilderformatType (MgrsFormatType formatType)
 Sets the luciad::MgrsFormatType. More...
 
Builderprecision (MgrsFormatPrecision precision)
 Sets the luciad::MgrsFormatPrecision used to format an MGRS or UTM/UPS string. More...
 
BuilderzoneSeparator (std::string zoneSeparator)
 Sets the string to use as zoneSeparator between the grid zone and the 100km squares when formatting MGRS strings. More...
 

Detailed Description

Builder for creating luciad::MgrsFormat.

Example usage:

.build();
Builder & coordinateSeparator(std::string coordinateSeparator)
Sets the string to separate the zone/grid letters and the coordinates.
Builder & zoneSeparator(std::string zoneSeparator)
Sets the string to use as zoneSeparator between the grid zone and the 100km squares when formatting M...
MgrsFormat build() const
Creates the MGRS format, based on the properties set on this builder.
Builder & formatType(MgrsFormatType formatType)
Sets the luciad::MgrsFormatType.
Builder & precision(MgrsFormatPrecision precision)
Sets the luciad::MgrsFormatPrecision used to format an MGRS or UTM/UPS string.
Class to format points as MGRS or UTM/UPS coordinates.
Definition: MgrsFormat.h:146
static Builder newBuilder()
Creates a new builder with the default values.
@ Mgrs
MGRS format type.
@ Precision1M
Precision of 1 meter.

Constructor & Destructor Documentation

◆ Builder()

luciad::MgrsFormat::Builder::Builder ( const Builder other)

◆ ~Builder()

luciad::MgrsFormat::Builder::~Builder ( )

Member Function Documentation

◆ build()

MgrsFormat luciad::MgrsFormat::Builder::build ( ) const

Creates the MGRS format, based on the properties set on this builder.

Returns
the MGRS format, based on the properties set on this builder.
Exceptions
luciad::LogicExceptionif the set precision is not compatible with the format type.

◆ coordinateSeparator()

Builder & luciad::MgrsFormat::Builder::coordinateSeparator ( std::string  coordinateSeparator)

Sets the string to separate the zone/grid letters and the coordinates.

Parameters
coordinateSeparatorthe coordinateSeparator. If not set, default is an empty string.
Returns
this builder.

◆ formatType()

Builder & luciad::MgrsFormat::Builder::formatType ( MgrsFormatType  formatType)

Sets the luciad::MgrsFormatType.

Parameters
formatType
Returns
this builder.

◆ precision()

Builder & luciad::MgrsFormat::Builder::precision ( MgrsFormatPrecision  precision)

Sets the luciad::MgrsFormatPrecision used to format an MGRS or UTM/UPS string.

luciad::MgrsFormatPrecision::Precision1000KM and luciad::MgrsFormatPrecision::PrecisionGridZone may not be used when the format type is set to luciad::MgrsFormatType::Mgrs.

Parameters
precisionthe precision. If not set, deafault is luciad::MgrsFormatPrecision::Precision1M.
Returns
this builder.

◆ zoneSeparator()

Builder & luciad::MgrsFormat::Builder::zoneSeparator ( std::string  zoneSeparator)

Sets the string to use as zoneSeparator between the grid zone and the 100km squares when formatting MGRS strings.

Parameters
zoneSeparatorthe zoneSeparator. If not set, default is an empty string.
Returns
this builder.