olp-cpp-sdk  1.22.0
WebMercatorProjection.h
1 /*
2  * Copyright (C) 2019 HERE Europe B.V.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * SPDX-License-Identifier: Apache-2.0
17  * License-Filename: LICENSE
18  */
19 
20 #pragma once
21 
22 #include <olp/core/CoreApi.h>
23 #include <olp/core/geo/projection/IProjection.h>
24 
25 namespace olp {
26 namespace geo {
37 class CORE_API WebMercatorProjection final : public IProjection {
38  public:
39  WebMercatorProjection() = default;
40 
41  GeoRectangle GetGeoBounds() const override;
42 
43  WorldAlignedBox WorldExtent(double minimum_altitude,
44  double maximum_altitude) const override;
45 
46  bool Project(const GeoCoordinates3d& geo_point,
47  WorldCoordinates& world_point) const override;
48  bool Unproject(const WorldCoordinates& world_point,
49  GeoCoordinates3d& geo_point) const override;
50 };
51 
52 } // namespace geo
53 } // namespace olp
Geodetic coordinates with longitude, latitude, and altitude.
Definition: GeoCoordinates3d.h:31
A rectangular area in the WGS84 Coordinate System.
Definition: GeoRectangle.h:33
The identity projection used to work with geographic and world coordinates.
Definition: IProjection.h:31
The Web Mercator projection.
Definition: WebMercatorProjection.h:37
GeoRectangle GetGeoBounds() const override
Gets the geodetic bounds represented by the projection.
bool Project(const GeoCoordinates3d &geo_point, WorldCoordinates &world_point) const override
Checks whether the geographic coordinates (latitude, longitude, altitude) of a point correspond to it...
WorldAlignedBox WorldExtent(double minimum_altitude, double maximum_altitude) const override
Creates the extent of world coordinates.
bool Unproject(const WorldCoordinates &world_point, GeoCoordinates3d &geo_point) const override
Checks whether the world coordinates (x,y,z) of a point correspond to its geographic coordinates (lat...
The aligned bounding-box implementation.
Definition: AlignedBox.h:98
Rules all the other namespaces.
Definition: AppleSignInProperties.h:24
Represents 3D vectors and points.
Definition: Vector.h:86