osgEarth adds geospatially accurate 3D maps to your C++ application.
![](https://private-user-images.githubusercontent.com/326618/359595595-a0b1c650-442a-4e6d-88e6-42a5c92083b8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1NjIxNjMsIm5iZiI6MTcyNDU2MTg2MywicGF0aCI6Ii8zMjY2MTgvMzU5NTk1NTk1LWEwYjFjNjUwLTQ0MmEtNGU2ZC04OGU2LTQyYTVjOTIwODNiOC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODI1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyNVQwNDU3NDNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04MjE0OWU1OGI2MzA3ODdhNzcwNGU5ZWEyOTc5YWY2OTY3N2EwNzMxNzMwNWQ5ZGNlOTI5YTIyNDAxYjgzODAzJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.QLXXKVJgtpM7w53Ez1hcfhaHp58kGBZt4P8oWtTVIlw)
![](https://private-user-images.githubusercontent.com/326618/359593463-08d0f8c0-49e1-41a8-8b97-d663337f1cbb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1NjIxNjMsIm5iZiI6MTcyNDU2MTg2MywicGF0aCI6Ii8zMjY2MTgvMzU5NT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16LVNpZ25hdHVyZT1lNGE5YTA0YzExYzA2NDM3MGM5Yjc5YjQ1NmI1NWU1NjJjN2UzMDM4MjNjNWU4YzdiNjM1NGFlNTcxYmUzNjYxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.vfnBomCysyAGa_jFrj769W7LQvBkqbeX2wBucHIp80k)
![](https://private-user-images.githubusercontent.com/326618/359593667-24971c79-f93c-48eb-ab79-161bb35beae4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1NjIxNjMsIm5iZiI6MTcyNDU2MTg2MywicGF0aCI6Ii8zMjY2MTgvMzU5NTkzNjY3LTI0OTcxYzc5LWY5M2MtNDhlYi1hYjc5LTE2MWJiMzViZWFlNC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODI1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyNVQwNDU3NDNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03Y2UyOWFiMzAwM2Q5ZjA4YjgyMzViYzlmNzgxZjY4ZDIyNzlkOTE3ZTk1M2VkNTA4MWFiNmRiMWQzMzVkZjNjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.Ziu7PyNSkAA2PMVOQfUqjzJPAbZkDGyD3o3zIsL8McE)
![](https://private-user-images.githubusercontent.com/326618/359597365-cf40e4a9-429d-4cac-9464-f9825149e7f2.png?jwt=e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NzM0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.wWY4EwuuoA5NfZe-MpH5wMf_SAYkT9yeI7oLjgKCdks)
![](https://private-user-images.githubusercontent.com/326618/359596237-1876fffb-e683-4fa9-9521-cdd9795dea85.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ1NjIxNjMsIm5iZiI6MTcyNDU2MTg2MywicGF0aCI6Ii8zMjY2MTgvMzU5NTk2MjM3LTE4NzZmZmZiLWU2ODMtNGZhOS05NTIxLWNkZDk3OTVkZWE4NS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODI1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgyNVQwNDU3NDNaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iMWIyZDIyNDQxZmI0ODU5MDNjMzAzZDEwZTg4ZTMzNDc2MDE0NTU5Yzc3OWNiMTE0OTNmMmJhOWYwYTJlNDYwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.RhTySNYKvqus5w0qpzE6A237YEvDORtuBpYQ1M_8D9s)
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.
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.
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
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)
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();
}
© Copyright Pelican Mapping