atlas
Projection.h
1 /*
2  * (C) Copyright 2013 ECMWF.
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  * In applying this licence, ECMWF does not waive the privileges and immunities
7  * granted to it by virtue of its status as an intergovernmental organisation
8  * nor does it submit to any jurisdiction.
9  */
10 
11 #pragma once
12 
13 #include <string>
14 
15 #include "atlas/domain/Domain.h"
16 #include "atlas/library/config.h"
17 #include "atlas/projection/detail/ProjectionImpl.h"
18 #include "atlas/util/ObjectHandle.h"
19 
20 //---------------------------------------------------------------------------------------------------------------------
21 
22 // Forward declarations
23 namespace eckit {
24 class Parametrisation;
25 class Hash;
26 namespace geometry {
27 class Point2;
28 }
29 } // namespace eckit
30 
31 //---------------------------------------------------------------------------------------------------------------------
32 
33 namespace atlas {
34 
35 class PointLonLat;
36 class PointXY;
37 using Point2 = eckit::geometry::Point2;
38 
39 //---------------------------------------------------------------------------------------------------------------------
40 namespace util {
41 class Config;
42 }
43 namespace projection {
44 namespace detail {
45 class ProjectionImpl;
46 }
47 } // namespace projection
48 
49 class Projection : DOXYGEN_HIDE( public util::ObjectHandle<projection::detail::ProjectionImpl> ) {
50 public:
51  using Spec = util::Config;
53 
54 public:
55  using Handle::Handle;
56  Projection();
57  Projection( const eckit::Parametrisation& );
58  Projection( const std::string& type, const eckit::Parametrisation& );
59 
60  operator bool() const;
61 
62  void xy2lonlat( double crd[] ) const;
63  void xy2lonlat( Point2& ) const;
64  void lonlat2xy( double crd[] ) const;
65  void lonlat2xy( Point2& ) const;
66 
67  Jacobian jacobian( const PointLonLat& ) const;
68 
69  PointLonLat lonlat( const PointXY& ) const;
70  PointXY xy( const PointLonLat& ) const;
71 
72  bool strictlyRegional() const;
73  RectangularLonLatDomain lonlatBoundingBox( const Domain& ) const;
74 
75  Spec spec() const;
76 
77  std::string units() const;
78 
79  std::string type() const;
80 
81  void hash( eckit::Hash& ) const;
82 };
83 
84 //---------------------------------------------------------------------------------------------------------------------
85 
86 } // namespace atlas
Point in longitude-latitude coordinate system.
Definition: Point.h:103
Definition: Projection.h:49
Definition: Domain.h:130
Definition: Domain.h:19
Definition: Domain.h:48
Point in arbitrary XY-coordinate system.
Definition: Point.h:40
Contains all atlas classes and methods.
Definition: atlas-grids.cc:33
Configuration class used to construct various atlas components.
Definition: Config.h:27