1#ifndef __JUTM__JUTMGRID__
2#define __JUTM__JUTMGRID__
22namespace JPP {
using namespace JUTM; }
94 const std::string&
wgs,
95 const std::string&
zone)
110 return static_cast<const JUTMGrid&
>(*this);
121 static_cast<JUTMGrid&
>(*this) = grid;
169 for (string::const_iterator i =
zone.begin(); i !=
zone.end(); ++i) {
171 value = 10 * value + (*i -
'0');
189 this->getWGS() == grid.
getWGS() &&
215 std::istringstream is(buffer);
233 return in >> grid.
key >> grid.
wgs >> grid.
zone;
246 return out << grid.
key <<
' ' << grid.
wgs <<
' ' << grid.
zone;
261 return in >> grid.
key >> grid.
wgs >> grid.
zone;
276 return out << grid.
key << grid.
wgs << grid.
zone;
STD extensions for binary I/O.
Interface for binary input.
Interface for binary output.
Exception for parsing value.
Data structure for UTM grid.
std::string toString() const
Convert UTM grid.
JUTMGrid(const std::string &key, const std::string &wgs, const std::string &zone)
Constructor.
friend std::ostream & operator<<(std::ostream &out, const JUTMGrid &grid)
Write UTM grid to output.
friend JReader & operator>>(JReader &in, JUTMGrid &grid)
Read UTM grid from input.
static JUTMGrid valueOf(const std::string &buffer)
Extract UTM grid.
const std::string & getKey() const
Get key.
friend std::istream & operator>>(std::istream &in, JUTMGrid &grid)
Read UTM grid from input.
const JUTMGrid & getUTMGrid() const
Get UTM grid.
friend JWriter & operator<<(JWriter &out, const JUTMGrid &grid)
Write UTM grid to output.
const std::string & getWGS() const
Get WGS.
int getZone() const
Get UTM zone by numerical value.
bool equals(const JUTMGrid &grid) const
Check equality.
void setUTMGrid(const JUTMGrid &grid)
Set UTM grid.
const std::string & getUTMZone() const
Get UTM zone.
JUTMGrid()
Default constructor.
Auxiliary classes and methods for binary I/O.
static const double PI
Mathematical constants.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliaries for handling universal transverse mercator coordinate system (UTM).
int getUTMZone(const double longitude)
Get UTM zone for given longitude.
static double getUTMLongitude(const int zone)
Get longitude of the central meridian for given UTM zone.
static const double UTM_ZONE_WIDTH_RAD
UTM zone width [rad].
Template definition of auxiliary base class for comparison of data structures.