Configuration

To define the area of interest and set various parameters, a configuration file called config_terrain.json, is provided in the applications directory. This file allows users to customize the input data for the terrain mesh generation process, ensuring that the output meshes accurately reflect the desired geographical region.


config_terrain.json file
{
    "useGPS": true,
    "precision": 0.5,
    "longitude": 5.7232,
    "latitude": 45.1835,
    "zoom": 16,
    "api_key": "[YOUR_API_KEY_HERE]"
}

Explanation of parameters:

  1. useGPS: (Boolean) Specifies whether to use real elevation data from GPS coordinates. When set to true, the program retrieves actual elevation data from the Mapbox API. If set to false, the program defaults to a synthetic elevation function, sin(x) + cos(y), which can be modified within the main_terrain.cpp file.

  2. precision: (Float) Defines the altitude interval for generating contour lines. This value determines the level of detail in the contouring process, with smaller values resulting in finer contour lines.

  3. longitude: (Float) Sets the longitude coordinate of the target area. This, in combination with latitude and zoom level, determines the specific map tile to be processed.

  4. latitude: (Float) Sets the latitude coordinate of the target area. Along with longitude and zoom level, this identifies the geographic region of interest.

  5. zoom: (Integer) Specifies the zoom level for the area of interest. Higher zoom levels provide more detailed map tiles, which are crucial for accurately representing small-scale topographic features.

  6. api_key: (String) Your unique API key for accessing Mapbox services. This key is necessary for retrieving the required elevation data and other map resources directly from Mapbox.



References