testLocalCoordinateSystem.cc
Go to the documentation of this file.
1 
11 #include <fwk/LocalCoordinateSystem.h>
12 #include <utl/AugerCoordinateSystem.h>
13 #include <utl/CoordinateSystem.h>
14 #include <utl/Point.h>
15 #include <utl/UTMPoint.h>
16 #include <utl/AugerUnits.h>
17 #include <fwk/CentralConfig.h>
18 #include <fwk/CoordinateSystemRegistry.h>
19 
20 #include <tst/Verify.h>
21 #include <cppunit/extensions/HelperMacros.h>
22 
23 using namespace fwk;
24 using namespace utl;
25 using namespace tst;
26 
27 
28 class LocalCoordinateSystemTest : public CppUnit::TestFixture {
29 
30  CPPUNIT_TEST_SUITE(LocalCoordinateSystemTest);
31  CPPUNIT_TEST(testCreate);
32  CPPUNIT_TEST_SUITE_END();
33 
34 public:
35  void setUp() { }
36 
37  void tearDown() { }
38 
39  void
41  {
42  CentralConfig::GetInstance(BOOTSTRAPFILE);
43 
44  //CoordinateSystemRegistry::InitXML();
46 
47  const ReferenceEllipsoid e = ReferenceEllipsoid::Get(ReferenceEllipsoid::eWGS84);
48  CoordinateSystemPtr ecef = e.GetECEF();
49 
50  const UTMPoint malargueOriginUTM(6060000*m, 440000*m, 0*m, 19, 'H', e);
51  const Point malargueOrigin(malargueOriginUTM.GetPoint());
52 
53  const UTMPoint centralCampusUTM(6075445*m, 446954*m, 1444*m, 19, 'H', e);
54  const Point centralCampus(centralCampusUTM.GetPoint());
55 
56  const CoordinateSystemPtr siteCS =
57  AugerBaseCoordinateSystem::Create(malargueOriginUTM, ecef);
58  const CoordinateSystemPtr campusCS =
59  AugerCoordinateSystem::Create(centralCampusUTM, siteCS);
60 
61  const CoordinateSystemPtr localCS =
62  LocalCoordinateSystem::Create(centralCampus);
63 
64  CPPUNIT_ASSERT(Verify<CloseTo>(campusCS->GetTransformation().Distance(localCS->GetTransformation()), 0.));
65  }
66 
67 };
68 
69 
71 
72 
73 // Configure (x)emacs for this file ...
74 // Local Variables:
75 // mode: c++
76 // End:
Point object.
Definition: Point.h:32
Class to hold and convert a point in geodetic coordinates.
Definition: UTMPoint.h:40
void Init()
Initialise the registry.
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
Reference ellipsoids for UTM transformations.
const CoordinateSystemPtr GetECEF() const
Get the ECEF.
static CentralConfig * GetInstance()
Use this the first time you get an instance of central configuration.
utl::CoordinateSystemPtr Get(const std::string &id)
Get a well-known Coordinate System.
static Policy::type Create(const utl::Point &theOrigin)
Create the standard local coordinate system for a Point.
Point GetPoint(const CoordinateSystemPtr &theCS=CoordinateSystemPtr()) const
Get a cartesian point from an UTMPoint.
Definition: UTMPoint.cc:45
constexpr double m
Definition: AugerUnits.h:121

, generated on Tue Sep 26 2023.