Code Monkey home page Code Monkey logo

polylines's People

Contributors

joshuaclayton avatar joshuacronemeyer 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

polylines's Issues

Lat, Lng vs Lng, Lat

Hi there,

Thanks for this wonderful library. I realize that google's algorithm anticipates latitude/longitude pairing. However, most pairings (including geojson data) are usually in the form of [longitude, latitude] or [x,y].

Does it make more sense for this gem's api to accept [longitude, latitude] pairings so that users can almost pump straight geojson data into it? This would make things much more convenient.

TypeError: nil can't be coerced into Float

I get this error when I run Polylines::Decoder.decode_polyline(encoded_points).

But, the same points works fine in Google's interactive decoder.

E.g. encoded_points = "epnyHvtb@DuAfAl@t@nDzAnAnm@mq@yi@iqBdn@w_Bas@mUi[i[TcCfAq@B\qBe@r@_@aGbJ"

Any idea why this could be happening?

problem with rounded

Hi,

I'm currently using the ruby gem polylines, and thank you for this.

However, I sometime experienced strange behaviour using the gem. Sometimes, I have problems with the output, it seems like there is an issue with rounding when i decode a polyline. If i compare with the array received from the official "Interactive Polyline Encoder Utility", sometimes, I haven't the same result.

https://developers.google.com/maps/documentation/utilities/polylineutility

For example, the string of the polylines used is :

"eyhiHkx}LcGdBGHAFa@WdCeL?IACKOH_@NF?PFqCfE}RTwB?Y|@@v@K`@Yn@oABcAGmAQ{@IiA@cBhGoXtMom@`TyaA^sBB}@Ga@KYMWk@i@y@iAOq@E{ALoB\\eCZwAJF\\uABM^TjLtI`ErCrBtAhAl@l@RTBNCf@]pF{EvMgMjI{Id@[XGxCa@`VyEpHwAtGkA|SyDzCm@X@NFPRnEzFNVJh@@|@oDdPlBpAe@c@D{@^FPH|EhG"

And I linked you 2 screenshots of the results, one with the Google Encoder Utility (on web page), and the other one with the Ruby Gem Polylines (in console).

The item selected on the list of the first screenshot correspond in the second to :

48.87205,2.3006

(rdb:1) array_poly1[25]
[48.87205000000001, 2.300600000000001]

As you can see the result seems rounded.

What do you think about that ? Have you ever experienced something similar?

Thank you,

Maxime

decode google utility

decode ruby gem polylines

Point Failure

Hi,

We're testing this out for our app and stumbled on some issues when encoding certain points.

for instance, doing:

Polylines::Encoder.encode_points([[41.3522171071184, -86.0456299662023],[41.3522171071183, -86.0454368471533]])

Gives the error

NoMethodError:
       undefined method `+' for nil:NilClass
     # ./lib/polylines/base.rb:62:in `block (2 levels) in step_10'
     # ./lib/polylines/base.rb:62:in `map'
     # ./lib/polylines/base.rb:62:in `block in step_10'
     # ./lib/polylines/base.rb:73:in `encode!'
     # ./lib/polylines/base.rb:62:in `step_10'
     # ./lib/polylines/encoder.rb:18:in `block in encode'
     # ./lib/polylines/encoder.rb:10:in `tap'
     # ./lib/polylines/encoder.rb:10:in `encode'
     # ./lib/polylines/encoder.rb:5:in `block in encode_points'
     # ./lib/polylines/encoder.rb:5:in `map'
     # ./lib/polylines/encoder.rb:5:in `encode_points'
     # ./spec/polylines/encoder_spec.rb:14:in `block (2 levels) in <top (required)>'

I'm not quite sure why only some points are failing. Any ideas?

not thread safe?

Was seeing very odd behavior (encoded lines suddenly becoming null) in production server. Looked over code and it seems there are some class level variables that might be overridden by competing threads. I didn't have time to fork and fix it, but thought I should mention this. We switched to https://github.com/nayutaya/googlemaps-polyline and things are back to normal.

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.