GithubHelp home page GithubHelp logo

isabella232 / polyline-spectrum Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mapbox/polyline-spectrum

0.0 0.0 0.0 34 KB

Cross-library cross-language test for polyline encoding and decoding

Ruby 5.99% JavaScript 8.84% Python 58.16% Shell 1.98% HTML 25.03%

polyline-spectrum's Introduction

polyline-spectrum

CircleCI

A spectrum test for implementations of the Google Encoded Polyline algorithm. This test compares multiple implementations across multiple languages:

  • Each implementation has a command-line utility called encode that takes a JSON string of a coordinate array in [latitude, longitude] order and transforms it into an encoded polyline, which it prints to stdout without any newlines or other information.
  • Each implementation has a command-line utility called decode that takes an encoded polyline string and prints a JSON-encoded coordinate array to stdout without any newlines or other information.
  • test.py runs each encode, decode pair against canonical test cases and compares the results.

Currently-tracked implementations

Results

Contributing a new implementation

  1. If the implementation uses a package manager like pip or npm, add the dependency to one of the dependency documents, like package.json. a. If that introduces a new dependency manager to the mix, add the install command to setup.py
  2. Create a directory in the format organization-reponame. For instance, the repository mapbox/polyline lives in mapbox-polyline.
  3. Create encode and decode CLI commands in that directory. The files should be executable (chmod +x), and have hashbang lines that find the correct interpreter for them to run
  4. Add the new implementation to the list of implementations in test.py
  5. Test the new implementation by running python test.py

Contributing a new test case

  1. Confirm that the test case is absolutely true. The Google polyline utility is our authoritative implementation.
  2. Add the pair of input and output to fixtures/canon.json
  3. Run python test.py to confirm behavior

How do I post an issue?

This is a pull requests for everything repository: if you need a new implementation covered, please follow the guide above to add it. Same if you find a bug, or need an additional test.

polyline-spectrum's People

Contributors

npmcdn-to-unpkg-bot avatar perrygeo avatar tmcw avatar

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.