GithubHelp home page GithubHelp logo

davidcelis / geocodio Goto Github PK

View Code? Open in Web Editor NEW
20.0 20.0 24.0 76 KB

A ruby client for the http://geocod.io/ API. Geocode with ease.

Home Page: http://geocod.io/

License: MIT License

Ruby 100.00%

geocodio's People

Contributors

benjiox avatar davidcelis avatar dlangsam avatar griffithchaffee avatar joshmosh avatar minicodemonkey avatar mojoware avatar

Stargazers

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

Watchers

 avatar  avatar

geocodio's Issues

Issue with additional fields example

Hello & Thanks for the awesome service/gem,

I think this example is wrong

address = geocodio.geocode(['54 West Colorado Boulevard Pasadena CA 91105'], fields: %w[cd stateleg school timezone])

address.congressional_district

since it #geocode returns addresses, you won't be able to do

address.congressional_district

The first line should use #best :

address = geocodio.geocode(['54 West Colorado Boulevard Pasadena CA 91105'], fields: %w[cd stateleg school timezone]).best

I know that because I learned the hard way :), It was not working for me.

Am I right?

Districts can be non-integers

Hey folks, small issue we ran into: Geocodio can return legislative districts that aren't integers (like Alaska State Senate districts, which are letters), but the library here casts them as integers, resulting on 0s.

Wanted to bring it to your attention.

bad/empty address causes Utils.parse_nested_method to barf

If you try to geocode a functionally empty string (in this case " , , "), whatever gets returned causes Utils to choke:

2.1.0 :074 > geocodio.geocode(' , , ')
Geocodio::Client::Error: Geocodio::Client::Error
    from /Users/ted/.rvm/gems/ruby-2.1.0/gems/geocodio-2.0.0/lib/geocodio/client.rb:147:in `request'
    from /Users/ted/.rvm/gems/ruby-2.1.0/gems/geocodio-2.0.0/lib/geocodio/client.rb:83:in `block (2 levels) in <class:Client>'
    from /Users/ted/.rvm/gems/ruby-2.1.0/gems/geocodio-2.0.0/lib/geocodio/client.rb:111:in `geocode_batch'
    from /Users/ted/.rvm/gems/ruby-2.1.0/gems/geocodio-2.0.0/lib/geocodio/client.rb:42:in `geocode'
    from (irb):74
    from /Users/ted/.rvm/rubies/ruby-2.1.0/bin/irb:11:in `<main>'

Which can be problematic if it's hidden in a batch (cause you don't get any of the results from the batch!)

Removing parse method/endpoint

According to the geocod.io docs as of June 2015 the parse endpoint has been deprecated. Geocode is now returning parsed address fields so maybe we should remove that from the gem as well.

Issue with timezone field

I think it's more an issue with the service, more than with the gem, but since I'm not sure here's the issue I'm experiencing :

While trying to lookup for this address: '6167 whitworth drive 90035 CA', I have this information returned

#<Geocodio::Address:0x007f96a6cd4580 @number=nil, @predirectional=nil, @street=nil, @suffix=nil, @city="Los Angeles", @state="CA", @zip="90005", @latitude="34.059163", @longitude="-118.306892", @timezone=#<Geocodio::Timezone:0x007f96a6cd4238 @name=nil, @utc_offset=0, @observes_dst=false>, @accuracy=0.33, @formatted_address="Los Angeles, CA 90005">

Here the issue is that @utc_offset=0 and @name=nil which is wrong.

Here's the snippet I have

geocodio = Geocodio::Client.new
booking_address = geocodio.geocode(['6167 whitworth drive 90035 CA'], fields: %w[timezone]).best

ap booking_address

Thanks,

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.