All Projects → vahancho → polylineencoder

vahancho / polylineencoder

Licence: MIT License
A C++ implementation of Google Encoded Polyline Algorithm Format (encoder/decoder)

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to polylineencoder

js-markerclusterer
Create and manage clusters for large amounts of markers
Stars: ✭ 92 (+513.33%)
Mutual labels:  maps, google-maps
map-kit-android
An extensive framework for map development in Android.
Stars: ✭ 44 (+193.33%)
Mutual labels:  maps, google-maps
trackanimation
Track Animation is a Python 2 and 3 library that provides an easy and user-adjustable way of creating visualizations from GPS data.
Stars: ✭ 74 (+393.33%)
Mutual labels:  maps, google-maps
ember-google-maps
A friendly Ember addon for working with Google Maps.
Stars: ✭ 93 (+520%)
Mutual labels:  maps, google-maps
mapus
A map tool with real-time collaboration 🗺️
Stars: ✭ 2,687 (+17813.33%)
Mutual labels:  maps, google-maps
GoogleMapsHelper
An easy to integrate Model Based Google Maps Helper (SVHTTPClient, AFNetworking) That lets you Geo Code , Reverse Geocode, Get Directions , Places Autocomplete.
Stars: ✭ 21 (+40%)
Mutual labels:  maps, google-maps
carto-react-template
CARTO for React. The best way to develop Location Intelligence (LI) Apps usign CARTO platform and React
Stars: ✭ 24 (+60%)
Mutual labels:  maps, google-maps
geojson-editor
A modified version of Googles Simple GeoJSON Editor
Stars: ✭ 43 (+186.67%)
Mutual labels:  maps, google-maps
EasyWayLocation
This library contain all utils related to google location. like, getting lat or long, Address and Location Setting dialog, many more...
Stars: ✭ 142 (+846.67%)
Mutual labels:  maps, google-maps
Dual-color-Polyline-Animation
This library will help to show the polyline in dual color similar as Uber.
Stars: ✭ 73 (+386.67%)
Mutual labels:  maps, google-maps
svelte-googlemaps
Svelte Google Maps Components
Stars: ✭ 62 (+313.33%)
Mutual labels:  maps, google-maps
carto-react
CARTO for React packages
Stars: ✭ 17 (+13.33%)
Mutual labels:  maps, google-maps
google maps
🗺 An unofficial Google Maps Platform client library for the Rust programming language.
Stars: ✭ 40 (+166.67%)
Mutual labels:  maps, google-maps
google-maps-at-88-mph
Google Maps keeps old satellite imagery around for a while – this tool collects what's available for a user-specified region in the form of a GIF.
Stars: ✭ 93 (+520%)
Mutual labels:  maps, google-maps
svelte-mapbox
MapBox Map and Autocomplete components for Svelte (or Vanilla JS)
Stars: ✭ 267 (+1680%)
Mutual labels:  maps, google-maps
activeadmin-latlng
Active Admin plugin for setting up latitude and longitude
Stars: ✭ 34 (+126.67%)
Mutual labels:  maps, google-maps
React Native Open Maps
🗺 A simple react-native library to perform cross-platform map actions (Google or Apple Maps)
Stars: ✭ 192 (+1180%)
Mutual labels:  maps, google-maps
Gmapsfx
Java API for using Google Maps within a JavaFX application.
Stars: ✭ 233 (+1453.33%)
Mutual labels:  maps, google-maps
HealthCare-Scan-Nearby-Hospital-Locations
I developed this android application to help beginner developers to know how to use Google Maps API and how to convert JSON data into Java Object.
Stars: ✭ 23 (+53.33%)
Mutual labels:  maps, google-maps
google-streetview-images
Pull google streetview panoramic images along a route.
Stars: ✭ 45 (+200%)
Mutual labels:  maps, google-maps

A C++ header-only Polyline Encoder/Decoder

C++ implementation of Google Encoded Polyline Algorithm Format.
The implementation guarantees to conform with the results of the Google Interactive Polyline Encoder Utility.

Latest release Build Status Build status codecov

Installation

As Polylineencoder is a single header library no installation required. Just include polylineencoder.h in your project and instantiate gepaf::PolylineEncoder class template.

Prerequisites

No special requirements except C++11 compliant compiler. The class is tested with gcc 4.8.4 and MSVC 12.0 (Visual Studio 2013). In order to build and run unit tests for this project you are required to have Google Test library installed on the system. For more details see the CI badges (Travis CI & AppVeyor CI).

Usage Example:

All code is in gepaf namespace. gepaf stands for Google Encoded Polyline Algorithm Format.

#include <polylineencoder.h>

// Create an encoder with precision of 5 decimal places (default)
// In order to create objects with other precision use template parameter
// like: gepaf::PolylineEncoder<6>
gepaf::PolylineEncoder<> encoder;

// Poles and equator.
encoder.addPoint(-90.0, -180.0);
encoder.addPoint(.0, .0);
encoder.addPoint(90.0, 180.0);

auto res = encoder.encode(); // "~bidP~fsia@_cidP_gsia@_cidP_gsia@"
encoder.clear(); // Clear the list of points.

// Decode a string using static function.
auto polyline = gepaf::PolylineEncoder<>::decode("~bidP~fsia@_cidP_gsia@_cidP_gsia@");

// Iterate over all points and print coordinates of each.
for (const auto &point : polyline) {
    printf("(%f, %f)\n", point.latitude(), point.longitude());
}

Building and Testing

There are unit tests provided for PolylineEncoder class template. You can find them in the test/ directory. To run them you have to build and run the test application (linking with Google Test library is required). For doing that you can invoke the following commands from the terminal, assuming that compiler and environment are already configured:

Linux (gcc)
cd test
g++ -std=c++11 -I..\src main.cpp -o test
./test

or with CMake

cd test
cmake ..
make
./poly_test
Windows
cd test
cl /W4 /EHsc /I..\src main.cpp /link /out:test.exe
test

or with CMake

cd test
cmake .. -G "NMake Makefiles"
nmake
poly_test

See Also

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].