then when I tried to load the package following the documentation:
hermes geocoder # irb
irb(main):001:0> require 'geocoder/us'
LoadError: no such file to load -- geocoder/us
from (irb):1:in `require'
from (irb):1
from :0
irb(main):002:0>
I'm familiar with Perl and new to Ruby. I'm obviously not addressing
the package correctly.
Yet:
hermes geocoder # gem specification Geocoder-US
--- !ruby/object:Gem::Specification
name: Geocoder-US
version: !ruby/object:Gem::Version
version: 2.0.0
platform: ruby
authors:
- Schuyler Erle
autorequire:
bindir: bin
cert_chain: []
date: 2010-03-22 00:00:00 +00:00
default_executable:
dependencies: []
description: US address geocoding based on TIGER/Line.
email: geoc...@entropyfree.com
executables: []
extensions: []
extra_rdoc_files:
- README.rdoc
files:
- lib/geocoder/us.rb
- lib/geocoder/us/sqlite3.so
- lib/geocoder/us/database.rb
- lib/geocoder/us/constants.rb
- lib/geocoder/us/address.rb
- lib/geocoder/us/import.rb
- lib/geocoder/us/numbers.rb
- tests/database.rb
- tests/constants.rb
- tests/address.rb
- tests/generate.rb
- tests/run.rb
- tests/benchmark.rb
- tests/numbers.rb
- README.rdoc
has_rdoc: true
homepage: http://geocoder.us/
licenses: []
post_install_message:
rdoc_options: []
require_paths:
- lib
required_ruby_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: "0"
version:
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
version: "0"
version:
requirements: []
rubyforge_project:
rubygems_version: 1.3.5
signing_key:
specification_version: 3
summary: US address geocoding based on TIGER/Line.
test_files:
- tests/run.rb
hermes geocoder #
On Mar 21, 11:06 pm, "John L. Poole" <jlpool...@gmail.com> wrote:
> I successfully installed:
<snip>
Perl coders beware: ruby does not automatically pick up packages
because you specified them in the file; you
have to load such as "-rubygems". See Chapter 3 of the Ruby Gems
manual.
My error was not running gems. For a script, example:
ruby -rubygems jlpooletest1.rb
I was able to run my test script -- though my output placed a test
address 30 miles out of town.
It would be helpful to have some examples that show a way to get a
higher precision.
Can you give me a sample of how you were inputting the address? Was
it as a single string or a hash with the pieces broken out?
-Kate
On Mar 22, 2:35 pm, Kate Chapman <k8chap...@gmail.com> wrote:
> John,
>
> Can you give me a sample of how you were inputting the address? Was
> it as a single string or a hash with the pieces broken out?
Here's my ruby script:
require 'text'
require 'geocoder/us'
db = Geocoder::US::Database.new("/var/work/tiger/geocoder.db")
p db.geocode("2133 First Street, Napa, CA")
# try a valid intersection
p db.geocode("First & Jefferson, Napa, CA")
# try an intersection that does not exist
p db.geocode("First & Third, Napa, CA")
here's my output:
hermes geocoder # ruby -rubygems jlpooletest1.rb
zip results 2
[{:city=>"Napa", :precision=>:city, :fips_county=>"06055", :lon=>"-122.311921", :zip=>"94558", :score=>0.506, :lat=>"38.516158", :state=>"CA"}]
zip results 2
zip results 2
[{:city=>"Napa", :precision=>:city, :fips_county=>"06055", :lon=>"-122.311921", :zip=>"94558", :score=>0.752, :lat=>"38.516158", :state=>"CA"}]
zip results 2
zip results 2
[{:city=>"Napa", :precision=>:city, :fips_county=>"06055", :lon=>"-122.311921", :zip=>"94558", :score=>0.75, :lat=>"38.516158", :state=>"CA"}]
hermes geocoder #
Incidentally, using sqlitebrowser, I checked the database and tables
features, features-edge, and range were empty. I'm confident at least
range should have values. So I'm going to start anew and document my
changes and warning error messages. In my hurry to get to the end, I
did not methodically document what I had done to get the end.
Obviously, one of the warnings was a fatal one in terms of the
database not being fully populated.
The project I'm working on that is driving this: being able to insert
two streets and if there is a valid intersection, returning the
coordinates thereof.
<snip>