Header-only C++17 geographic geometry utilities
Practical latitude/longitude geometry for C++17 projects that need GPS math, not a full geometry framework.
Distance, heading, polygon area, point-in-polygon, and path proximity checks — header-only, no dependencies, no build step.
The API is inspired by Google Maps geometry utilities and uses the same spherical Earth approximation model.
Features
- Lat/lng-native API — pass latitude/longitude coordinates directly, no framework-specific point types to convert through.
- Header-only, dependency-free — about 50 KB across 8 headers; nothing to build or link.
- Spherical math — distance, heading, offset, interpolation, area.
- Polygon utilities — point-in-polygon, path proximity, snap-to-route
(
closest_point_on_path), Douglas–Peucker simplification, andLatLngBoundsviewport math. - Polyline encoding —
encode/decodefor the Google Encoded Polyline format, including the polyline6 grid used by OSRM/Valhalla/Mapbox. - Fast — matches hand-written haversine on
distance; especially strong on polygonarea(see benchmarks). - Focused scope — intentionally small API for GPS, navigation, tracking, backend, and GIS workflows.
... More
| license | Apache-2.0 |
|---|---|
| project | geo-utils-cpp |
| url | github.com/gistrec/geo-utils-cpp |
| doc-url | github.com/gistrec/geo-utils-cpp/tree/master/docs |
| src-url | github.com/gistrec/geo-utils-cpp |
| gistrec@gmail.com | |
| topics | geographygeometrysphericaldistanceheader-only |
3 Versions
| version | 1.2.0 |
|---|---|
| repository | https://pkg.cppget.org/1/testing |
| depends | 0 |
| reviews | 0 |
| version | 1.1.0 |
|---|---|
| repository | https://pkg.cppget.org/1/testing |
| depends | 0 |
| reviews | 0 |
| version | 1.0.2 |
|---|---|
| repository | https://pkg.cppget.org/1/testing |
| depends | 0 |
| reviews | 0 |