The HERE OLP SDK for C++ is a C++ client for the HERE Open Location Platform.
Platform | Status |
---|---|
Linux | |
MacOS | |
iOS | |
Windows | |
Android |
Platform | Status |
---|---|
Linux |
The Open Location Platform (OLP) SDK for C++ provides support for the core HERE OLP use cases through a set of native C++ interfaces. The SDK is intended to save your time and effort on using OLP REST APIs. It provides a set of stable APIs that simplify complex OLP operations and keeps up to date with the latest OLP REST API changes.
The OLP SDK for C++ is a modern (C++11), lightweight, and modular SDK with minimal dependencies targeted towards a wide range of hardware platforms from embedded devices to desktops.
This SDK lets you:
- Authenticate to HERE OLP using client credentials
- Read catalog and partition metadata
- Retrieve data from versioned and volatile layers of OLP catalogs
- Upload data to OLP
Additionally, the SDK includes classes for work with geospatial tiling schemes that are used by most OLP catalog layers.
The table below lists the platforms on which the OLP SDK for C++ has been tested.
Platform | Minimum requirement |
---|---|
Ubuntu | GCC 5.4 and Clang 7.0 |
Embedded Linux (32/64 bit) | GCC-arm/GCC-aarch64 5.4 |
Windows | MSVC++ 2017 |
macOS | Apple Clang 11.0.0 |
iOS | Xcode 11.1, Swift 5.0 |
Android | API level 21 |
The table below lists the dependencies of the HERE OLP SDK for C++.
Library | Minimum version |
---|---|
OpenSSL | 1.0.2 |
Boost (headers only) | 1.69.0 |
LevelDB | 1.21 |
Snappy | 1.1.7 |
RapidJSON | latest |
To build the HERE OLP SDK for C++ on Linux, additionally to the dependencies listed in the previous section, you also need to have libcurl 7.47.0 or later.
To install the dependencies on Linux, run the following command:
sudo apt-get update && sudo apt-get --yes install git g++ make cmake libssl-dev libcurl4-openssl-dev libboost-all-dev
By default, the HERE OLP SDK for C++ downloads and compiles its dependencies. The versions of the downloaded dependencies may conflict with the versions that are already installed on your system. Therefore, the downloaded dependencies are not added to the install targets.
You can use the HERE OLP SDK for C++ in your CMake project or install it on your system.
Тo use the SDK directly in your CMake project, add the SDK via add_subdirectory()
.
To install the SDK on your system:
-
Install all the dependencies needed for the SDK.
For more information on dependencies, see the Dependencies and Additional Linux Dependencies sections. -
(Optional) To find the required dependencies in the system, set the
OLP_SDK_BUILD_EXTERNAL_DEPS
flag toOFF
. -
(Optional) To build the SDK as a shared library, set the
BUILD_SHARED_LIBS
flag toON
.
Example
The following command builds and installs the HERE OLP SDK for C++:
cmake --build . --target install
CMake is the main build system. The minimal required version of CMake is 3.9.
CMake downloads LevelDB, Snappy, RapidJSON, and Boost. To disable downloading, set OLP_SDK_BUILD_EXTERNAL_DEPS
to OFF
. For details on CMake flags, see the CMake Flags section.
To build the HERE OLP SDK for C++:
- Clone the repository folder.
- In the root of the repository folder, run the following commands:
mkdir build && cd build
cmake ..
cmake --build .
If you cannot build the SDK on Windows using this instruction, see Build on Windows.
We assume that you have installed CMake, Microsoft Visual Studio 2017, and the Visual C++ tools for CMake component.
To build the HERE OLP SDK for C++ on Windows:
-
Launch Microsoft Visual Studio as administrator.
-
Open the folder containing the SDK or a CMake-based project that uses the SDK.
-
In Microsoft Visual Studio, check that the target does not contain "(Default)".
For example, select "x64-Debug" instead of "x64-Debug (Default)". -
Using the CMake menu provided by the Visual C++ tools for CMake, generate the
.cmake
files, and build the entire project with default options.
Note: Microsoft Visual Studio uses a default build directory that has a long path name. Since dependencies for the SDK are installed within the build directory, it is recommended that you edit the generated
CMakeSettings.json
file and change the build directory path name to a shorter path name. This ensures that the maximum length of each path is not greater than 260 characters. For details, see the Naming Files, Paths, and Namespaces section of the Windows Dev Center documentation.
If you want to build documentation from annotated source code, you need to have Doxygen and CMake version 3.9 or later.
To generate Doxygen documentation, set the OLP_SDK_BUILD_DOC
flag to ON
when running the CMake configuration:
mkdir build && cd build
cmake -DOLP_SDK_BUILD_DOC=ON ..
cmake --build . --target docs
Flag | Description |
---|---|
BUILD_SHARED_LIBS |
Defaults to OFF . If enabled, all libraries are built as shared. |
OLP_SDK_BUILD_DOC |
Defaults to OFF . If enabled, the API reference is generated in your build directory.Note: Before you download the API reference, install Doxygen. |
OLP_SDK_ENABLE_TESTING |
Defaults to ON . If enabled, unit tests are built for each library. |
OLP_SDK_BUILD_EXTERNAL_DEPS |
Defaults to ON . If enabled, CMake downloads and compiles dependencies. |
OLP_SDK_NO_EXCEPTION |
Defaults to OFF . If enabled, all libraries are built without exceptions. |
OLP_SDK_BOOST_THROW_EXCEPTION_EXTERNAL |
Defaults to OFF . When OLP_SDK_NO_EXCEPTION is ON , boost requires boost::throw_exception() to be defined. If enabled, the external definition of boost::throw_exception() is used. Otherwise, the library uses own definition. |
OLP_SDK_MSVC_PARALLEL_BUILD_ENABLE (Windows Only) |
Defaults to ON . If enabled, the /MP compilation flag is added to build the SDK using multiple cores. |
To learn how to use the HERE OLP SDK for C++, see the Getting Started Guide.
For details, see the HERE OLP SDK C++ Contributors Guide.
Copyright (C) 2019–2020 HERE Europe B.V.
For license details, see the LICENSE file in the root of this project.
Note: This project has Open Source Software dependencies that are downloaded and installed upon execution of the abovementioned installation commands. For further details, see the CMake configuration files included in the external directory.