davidcelis / geocodio Goto Github PK
View Code? Open in Web Editor NEWA ruby client for the http://geocod.io/ API. Geocode with ease.
Home Page: http://geocod.io/
License: MIT License
A ruby client for the http://geocod.io/ API. Geocode with ease.
Home Page: http://geocod.io/
License: MIT License
There're several fields being missed according to docs:
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?
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.
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!)
And there's no way to set the read_timeout
on the http object
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.
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,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.