logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

osgearth

Add geospatially accurate 3D maps to C++ applications, enabling developers to integrate and display complex geographical data visually.

Author

osgearth logo

xixilidao

Other

Quick Info

GitHub GitHub Stars 0
NPM Weekly Downloads 0
Tools 1
Last Updated 2026-02-19

Tags

mapsgeospatially3dgeographical datamaps applications3d maps

Windows Linux OSX

Welcome to osgEarth!

osgEarth adds geospatially accurate 3D maps to your C++ application.

a0b1c650_442a_4e6d_88e6_42a5c92083b8 08d0f8c0_49e1_41a8_8b97_d663337f1cbb 575315e1_e2ae_43ec_8a97_83bafcfa9131 24971c79_f93c_48eb_ab79_161bb35beae4 cf40e4a9_429d_4cac_9464_f9825149e7f2 1cd49290_9b2d_42ec_a8c3_9c1c38eb673c bfd869fd_32b5_48b5_a037_4951f812b757 1876fffb_e683_4fa9_9521_cdd9795dea85

osgEarth builds on trusted open source technologies like OpenSceneGraph and GDAL to give you high-performance, accurate terrain and map rendering. It supports a myriad of geospatial data formats and map projections.

Install the SDK

Windows users can install the latest version of osgEarth through vcpkg:

git clone https://github.com/microsoft/vcpkg.git
cd vcpkg && bootstrap-vcpkg.bat
vcpkg install osgearth:x64-windows

This will take a while the first time as vcpkg builds osgEarth and its dependencies.

Check out some examples

osgearth_imgui is the main command-line viewer. osgearth_viewer is a stripped-down viewer without any GUI. Both of these read "earth files", XML files that describe the contents of a map.

You can find example earth files in the tests folder of the repo.

:: Online imagery and elevation:
osgearth_imgui tests\readymap.earth

:: OpenStreetMap:
osgearth_imgui tests\osm.earth

:: Local GeoTIFFs:
osgearth_imgui tests\simple.earth 

Integrate it into your project

CMakeLists.txt

cmake_minimum_required(VERSION 3.20)
project(myApp)
find_package(osgEarth CONFIG REQUIRED)
add_executable(myApp main.cpp)
target_link_libraries(myApp PRIVATE osgEarth::osgEarth)
install(TARGETS myApp RUNTIME DESTINATION bin)

main.cpp

#include <osgEarth/MapNode>
#include <osgEarth/TMS>
#include <osgEarth/EarthManipulator>
#include <osg/ArgumentParser>
#include <osgViewer/Viewer>

int main(int argc, char** argv)
{
    osgEarth::initialize();

    osg::ArgumentParser args(&argc, argv);
    osgViewer::Viewer viewer(args);

    auto imagery = new osgEarth::TMSImageLayer();
    imagery->setURL("https://readymap.org/readymap/tiles/1.0.0/7/");

    auto mapNode = new osgEarth::MapNode();
    mapNode->getMap()->addLayer(imagery);

    viewer.setSceneData(mapNode);
    viewer.setCameraManipulator(new osgEarth::EarthManipulator(args));

    return viewer.run();
}

Resources


© Copyright Pelican Mapping

See Also

`