Giter Site home page Giter Site logo

chrberger / wgs84tocartesian Goto Github PK

View Code? Open in Web Editor NEW
73.0 5.0 17.0 274 KB

A simple header-only, single-file library to handle WGS84 coordinate to Cartesian coordinate transformations for C++.

License: MIT License

CMake 0.51% C++ 99.49%
cpp11 header-only single-file cpp14 cpp17 platform-independent wgs84 cartesian coordinates coordinate-transformation

wgs84tocartesian's Introduction

WGS84toCartesian - a simple header-only, single-file library to convert WGS84 positions (latitude/longitude) to/from Cartesian positions using Mercator projection for C++

Build Status Build status License: MIT

WGS84toCartesian is a small and efficient library written in modern C++ library to convert WGS84 latitude/longitude positions to/from Cartesian positions using Mercator projection.

WGS84toCartesian is available as single-file, header-only library - just drop WGS84toCartesian.hpp into your project, #include "WGS84toCartesian.hpp", and compile your project with a modern C++ compiler (C++11 or newer).

This library is partially based on the work from Gerald I. Evenden on proj 4.3 released under public domain terms. See thirdparty/proj-4.3 for further details.

Table of Contents

Features

  • Written in highly portable and high quality C++11
  • Available as header-only, single-file distribution - just drop WGS84toCartesian.hpp into your project, #include "WGS84toCartesian.hpp", and compile your project with a modern C++ compiler (C++11 or newer)
  • The positions are passed to and returned from the functions as std::array so that this library integrates well with other math libraries (e.g., Eigen).
  • Convert a given WGS84 position to a Cartesian position using a given WGS84 reference position with Mercator projection: std::array<double, 2> cartesianPosition = wgs84::toCartesian({52.247041, 10.575830} /* reference position */, {52.248091, 10.57417} /* position to be converted */));
  • Convert a given WGS84 position to a Cartesian position using a given WGS84 reference position with Mercator projection: Another example
  • Approximate a given Cartesian position with a WGS84 position using a given WGS84 reference position with Mercator projection: std::array<double, 2> approximatedWGS84Position = wgs84::fromCartesian({52.247041, 10.575830} /* reference position */, {-154.48, 441.75} /* position to be converted */);
  • Approximate a given Cartesian position with a WGS84 position using a given WGS84 reference position with Mercator projection: Another example

Dependencies

No dependencies! All you need is a C++11-compliant compiler (we are testing with GCC 6.3.0 and MSVC 19.0.24215.1) as the project ships the following dependencies as part of the source distribution:

Installation

Installation as single-file, header-only library

WGS84toCartesian is provided as header-only, single-file library as well - just drop WGS84toCartesian.hpp into your project, #include "WGS84toCartesian.hpp", and compile your project with a modern C++ compiler (C++11 or newer)

Projects using WGS84toCartesian

If your project is using WGS84toCartesian, just let us know :-)

Contributing

We are happy to receive your PRs to accelerate libcluon's development; before contributing, please take a look at the Contribution Documents.

License

  • This project is released under the terms of the MIT License - License: MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.