| 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 |
#include "eckit/utils/Hash.h" |
| 12 |
|
| 13 |
#include "atlas/option/Options.h" |
| 14 |
#include "atlas/projection/Projection.h" |
| 15 |
#include "atlas/projection/detail/LonLatProjection.h" |
| 16 |
#include "atlas/projection/detail/ProjectionImpl.h" |
| 17 |
#include "atlas/util/Config.h" |
| 18 |
|
| 19 |
namespace atlas { |
| 20 |
|
| 21 |
Projection::Projection(): Handle(new projection::detail::LonLatProjection()) {} |
| 22 |
|
| 23 |
Projection::Projection(const eckit::Parametrisation& p): Handle(Implementation::create(p)) {} |
| 24 |
|
| 25 |
Projection::Projection(const std::string& type, const eckit::Parametrisation& p): |
| 26 |
Handle(Implementation::create(type, p)) {} |
| 27 |
|
| 28 |
atlas::Projection::operator bool() const { |
| 29 |
return get()->operator bool(); |
| 30 |
} |
| 31 |
|
| 32 |
void Projection::hash(eckit::Hash& h) const { |
| 33 |
get()->hash(h); |
| 34 |
} |
| 35 |
|
| 36 |
void atlas::Projection::xy2lonlat(double crd[]) const { |
| 37 |
get()->xy2lonlat(crd); |
| 38 |
} |
| 39 |
|
| 40 |
void atlas::Projection::xy2lonlat(Point2& point) const { |
| 41 |
get()->xy2lonlat(point); |
| 42 |
} |
| 43 |
|
| 44 |
void atlas::Projection::lonlat2xy(double crd[]) const { |
| 45 |
get()->lonlat2xy(crd); |
| 46 |
} |
| 47 |
|
| 48 |
void atlas::Projection::lonlat2xy(Point2& point) const { |
| 49 |
get()->lonlat2xy(point); |
| 50 |
} |
| 51 |
|
| 52 |
atlas::Projection::Jacobian atlas::Projection::jacobian(const PointLonLat& p) const { |
| 53 |
return get()->jacobian(p); |
| 54 |
} |
| 55 |
|
| 56 |
PointLonLat atlas::Projection::lonlat(const PointXY& xy) const { |
| 57 |
return get()->lonlat(xy); |
| 58 |
} |
| 59 |
|
| 60 |
PointXY atlas::Projection::xy(const PointLonLat& lonlat) const { |
| 61 |
return get()->xy(lonlat); |
| 62 |
} |
| 63 |
|
| 64 |
bool atlas::Projection::strictlyRegional() const { |
| 65 |
return get()->strictlyRegional(); |
| 66 |
} |
| 67 |
|
| 68 |
RectangularLonLatDomain Projection::lonlatBoundingBox(const Domain& domain) const { |
| 69 |
return get()->lonlatBoundingBox(domain); |
| 70 |
} |
| 71 |
|
| 72 |
Projection::Spec atlas::Projection::spec() const { |
| 73 |
return get()->spec(); |
| 74 |
} |
| 75 |
|
| 76 |
std::string atlas::Projection::units() const { |
| 77 |
return get()->units(); |
| 78 |
} |
| 79 |
|
| 80 |
std::string Projection::type() const { |
| 81 |
return get()->type(); |
| 82 |
} |
| 83 |
|
| 84 |
} // namespace atlas |