GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - iontodirel/position-lib: Header only position representation, conversion and formatting

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
install_dependencies.sh
install_dependencies.sh
 
 
position.hpp
position.hpp
 
 

Repository files navigation

Header only coordinate representation, conversion and formatting utilities

Usage example

In the example below, we store coordinates in Decimal Degrees format, convert them to DDM and to DMS, then use a string formatter to convert coordinates as strings.

position_dd dd(47.51863818403278, -122.29686387310251);
position_ddm ddm = dd;
position_dms dms = dd;

position_display_string dd_fmt = format(dd, position_dd_format);
assert(dd_fmt.lat == "47.518638");
assert(dd_fmt.lon == "-122.296864");

position_display_string ddm_fmt = format(ddm, position_ddm_format);
assert(ddm_fmt.lat == "47°31.118'N");
assert(ddm_fmt.lon == "122°17.812'W");

position_display_string dms_fmt = format(dms, position_dms_format);
assert(dms_fmt.lat == "47°31'7.10\"N");
assert(dms_fmt.lon == "122°17'48.71\"W");

Tests

Tests are stored in ./tests/position_tests.cpp and are run automatically via a github action, on Ubuntu and Windows using the MSVC and GCC compilers.

Integration with CMake

As this is a header only library, you can simple download the header and use it:

file(DOWNLOAD https://raw.githubusercontent.com/iontodirel/position-lib/main/position.hpp ${CMAKE_SOURCE_DIR}/external/position.hpp )

Include the header:

#include "external/position.hpp"

About

Header only position representation, conversion and formatting

Topics

coordinatescoordinates-transformationscppgnssgpslibrarylocationposition

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.