12 #include <fwk/CoordinateSystemRegistry.h>
13 #include <utl/CoordinateSystem.h>
14 #include <utl/AugerCoordinateSystem.h>
15 #include <utl/ReferenceEllipsoid.h>
16 #include <utl/UTMPoint.h>
17 #include <utl/AugerUnits.h>
18 #include <utl/AugerException.h>
19 #include <utl/ErrorLogger.h>
20 #include <utl/ShadowPtr.h>
21 #include <fwk/CentralConfig.h>
22 #include <utl/Reader.h>
23 #include <utl/config.h>
24 #include <utl/Deprecator.h>
33 namespace CoordinateSystemRegistry {
37 typedef map<std::string, CoordinateSystemPtr> Registry;
44 RegisterOne(
const std::string&
id,
47 const bool ok = gRegistry->insert(std::make_pair(
id, cs)).second;
49 std::ostringstream msg;
50 msg <<
"Double insertion of coordinateSystem with id " << id;
60 gRegistry =
new Registry;
62 const std::string msg =
63 "Calling Init(), but CoordinateSystemRegistry already initialized.";
70 RegisterOne(
"ECEF", ecef);
75 if (cB.GetName() ==
"CoordinateSystem") {
76 const std::string name = cB.
GetChild(
"Id").
Get<std::string>();
77 const double northing = cB.GetChild(
"Northing").Get<
double>();
78 const double easting = cB.GetChild(
"Easting").Get<
double>();
79 double height = cB.GetChild(
"Height").Get<
double>();
80 const int zone = cB.GetChild(
"Zone").Get<
int>();
81 const char band = cB.GetChild(
"Band").Get<
char>();
82 const UTMPoint origin(northing, easting, height, zone, band,wgs84);
84 RegisterOne(name, cs);
91 Get(
const std::string&
id)
96 Registry::iterator it = gRegistry->find(
id);
98 if (it == gRegistry->end()) {
99 std::ostringstream msg;
100 msg <<
"Coordinate system with id " <<
id <<
" does not exist.";
113 Deprecator::GetInstance().Deprecated(
114 "fwk::CoordinateSystemRegistry::Get(const CoordinateSystemID&)",
116 "For fetching coordinate system config from XML use "
117 "fwk::CoordinateSystemRegistry::Get(const CoordinateSystemXMLID&)"
127 return Get(
"Malargue");
129 return Get(
"PampaAmarilla");
137 return Get(
"NewYork");
141 std::ostringstream msg;
142 msg <<
"Coordinate system with id " <<
id <<
" does not exist. Please use the new interface, "
143 "and define your coordinate system in 'coordinateSystemList.xml'.";
Branch GetTopBranch() const
static Policy::type Create(const Point &theOrigin, const ReferenceEllipsoid &theEllipsoid, const CoordinateSystemPtr &theReferenceCS)
Class to hold and convert a point in geodetic coordinates.
The X-treme laser facility XLF.
The central laser facility CLF.
void Init()
Initialise the registry.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
static const ReferenceEllipsoid & Get(const EllipsoidID theID)
Get known ellipsoid by registered ID.
Exception to use if sequence of initialisations violated.
Branch GetNextSibling() const
Get next sibling of this branch.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
Class representing a document branch.
Reference ellipsoids for UTM transformations.
Base class for exceptions in the CoordinateSystemRegistry.
northern site CS (exact position to be decided...)
Approximate centre of the southern site.
#define WARNING(message)
Macro for logging warning messages.
southern site CS as of conventions
CoordinateSystemID
Identifiers for all well-known coordinate systems.
utl::CoordinateSystemPtr Get(const std::string &id)
Get a well-known Coordinate System.
static void InitWithECEF(const CoordinateSystemPtr &theECEF)
Initialise the registry specifying the ECEF (instead of the Root CS)
Branch GetFirstChild() const
Get first child of this Branch.
#define ERROR(message)
Macro for logging error messages.
Earth centred, Earth fixed CS.