GithubHelp home page GithubHelp logo

frederickjansen / polyline Goto Github PK

View Code? Open in Web Editor NEW
112.0 112.0 19.0 66 KB

A Python implementation of Google's Encoded Polyline Algorithm Format.

Home Page: http://goo.gl/PvXf8Y

License: MIT License

Python 100.00%
polyline python

polyline's People

Contributors

asmfreak avatar flc avatar frederickjansen avatar paltman avatar perrygeo avatar sgillies avatar tjni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

polyline's Issues

Wrong coordinates order: Lon/lat vs lat/lon (sorry…)

I know it is heated question, and I usually wouldn’t want to impose my point of view.

However, currently, a string is decoded as [(lat, lon)…] while it is (lon, lat) (aka x,y on a planar map) on https://github.com/mapbox/polyline that inspired this library.

This makes it a bit cumbersome to use geojson as it also expects coordinates in the (x,y) order.

I don’t mind fixing it and making a pull request. However, I want to be sure that the original author agrees with that view.

IndexError: string index out of range

string
'jq~DcfwbViCeLy@wDcBgEMYrFqDrFmDfDyBnBqAbHiETMfFqCTMpIaDFCHGzBkAjB_ArAo@zBo@xCi@bDi@nEm@zC%5BpCUt@CrAGNABMNaABO%7CA_ODk@lB_Th@GJeDI@kDgDSUe@c@kHgHwBuBMKa@@@%5BHUVo@pEiLVu@xCqHFMTg@JWL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@pAzAZ%5Ch@n@TXHHRV@?nBzB%7CBjC%60BhBt@z@X%5C%60AjAX%5EpChDHJd@h@NP%7C@hANXzApCLTtAhChAtB%7C@%60BFJlA%7CBzApClAzBj@dAh@%60Al@jAZj@FLt@pAV%60@%60FtIhAbA%5CZvCtCjAdALvKlBbBLHPPLLhBzABBXZtAxARDPLDJFXFZFRRZh@n@v@%7C@%5Eb@xA%60C%7CAbCn@pAtB%7CDlCvGAn@%7C@zCdBDPTz@fCn@lBbAxCv@BhAtFp@hDVjAtDtQREfCq@%5EKbFsA%7CCKjAzE@fdh@dCBLlCbJ%7C@%60DX%60Ap@BFTv@jCNl@d@ADLt@lCv@pC%60@tAVx@lAfELb@x@tCH%5C@bdj@nBt@rCr@hCh@nBx@zCJAfAKHAz@IXC%5C?XApCUlCSJAz@GNAZCXEl@Kx@Mn@Kd@If@I@oh@IREp@ObASbCfIBHFVBJFARGDAFCl@QtFcBbAUt@QnAYPQxAYxDy@ZbDRpAvAxDd@nADJlApCJTP%5Ef@fABFtAbC%60AvBBDjHsDt@%5BlAc@xAa@fE}@jcc@hAS%60Ba@vFsARA%60BClADTBd@HfBf@dEhBfObIfCx@@l%7C@NdJVd@H%7C@PzAl@t@b@%60At@fAjALNf@l@@@jn@Bp@bBh@bBAFDPZpAbAjEb@hAl@hAz@bAfBpAvJjE%60RlJzAt@hDbCzBnBTTb@%5Cj@p@l@t@%5Cb@p@x@FJhAzAnEFh@l@xBbCjCzBfA~@PNNNDDdBlBTXbClCHJlAjBlCjEz@hDl@zBH%5CpAnJF%60@ZjJBrI@bM?f@?rB?l@AzEBl@J%60Ep@vHLvABPJp@DXBLR%7CAPbAvAzFZrADLXt@m@%5Cy@j@tAtCk@f@h@nA%7CAvD'

returns IndexError: string index out of range error . it's weird ,but i use https://github.com/mapbox/polyline , it works .

Newlines are not allowed in summary

Hi, I got this warning while installing the package:

/usr/lib/python3.11/site-packages/setuptools/_core_metadata.py:157: SetuptoolsDeprecationWarning: Invalid config.
!!

        ********************************************************************************
        newlines are not allowed in `summary` and will break in the future
        ********************************************************************************

!!
  write_field('Summary', single_line(summary))

Uses unmaintained/obsolete nose testing framework

Hello,

This report comes from the Debian bug tracker, Bug#1018439

Polyline still uses nose 1, which is an obsolete testing framework for
Python, dead and unmaintained since 2015 2.

It would be good to port polyline to one of the alternatives: nose2 4, pytest 5
or unittest from Python standard library 6.

There is a script called nose2pytest 7 which can assist with migrating from
nose to pytest.

Any interest in a PR that addresses this? Any particular direction / alternative you'd prefer?

Up to 70x faster computation

Hi,

I'm the author of fast-polylines gem in ruby and in crystal. I've recently created an equivalent project in python, that takes advantage of C bindings to compute way faster.

I still have some work to do on it, mainly tests and documentation. But rather than publishing a new library, I was thinking that I could merge this into your project. No need for two competing libraries. Great for me: you already have documentation and tests (although I'd add a few tests relative to how it is implemented in C). Great for you: way better perfs.

Here's a quick benchmark I made to showcase efficiency, you can run it locally as well:

git clone [email protected]:buonomo/fast-polyline.py
cd fast-polyline.py
make install
make bench

encode

fast_polyline: 0.583ms
polyline: 39.7ms
fast_polyline is 68.1 times faster.

decode

fast_polyline: 1.53ms
polyline: 25.9ms
fast_polyline is 17.0 times faster.

Note that performances would be improved a bit more before publication, especially on decode.

Also, Since it would change in lot in the codebase, I'd be happy to help maintaining the project afterward and having my email mentionned in the pyproject.toml.

Encoded my points, but moved decimal over two places.

I had a polygon it encoded, here are the first two points:
[(45.01659550333779, -72.84230558748105), (45.01648444523865, -72.83481118517622)]

It produced a polyine for me, BUT they were in the wrong place.

It encode them as:

(0.45017, -0.72842), (0.45016, -0.72835)

Any ideas?

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.