geocommons / geocoder

Modular Street Address Geocoder
http:///www.geocommons.com
GNU Lesser General Public License v3.0
395 stars 89 forks source link

No addresses are parsed #6

Closed donpdonp closed 15 years ago

donpdonp commented 15 years ago

No matter what address I give, the geocoder returns nothing. It appears the Address class is not parsing addresses of any kind.

irb(main):001:0> require 'geocoder/us' => true

irb(main):002:0> db = Geocoder::US::Database.new("/var/www/geocoder/OR_multnomah.db")

=> #<Geocoder::US::Database:0x849ede4 @db=#<SQLite3::Database:0x849ed90 @driver=#<SQLite3::Driver::Native::Driver:0x8372084 @callback_data={}, @authorizer={}, @busy_handler={}, @trace={}>, @statement_factory=SQLite3::Statement, @handle=#SWIG::TYPE_p_sqlite3:0x8371f88, @closed=false, @results_as_hash=false, @type_translation=false, @translator=nil, @transaction_active=false>, @st={}> irb(main):003:0> db.geocode("100 Main St, Portland, Or") => []

irb(main):004:0> a = Geocoder::US::Address.new("100 Main St, Portland, Or") => #<Geocoder::US::Address:0x835c460 @text="100 Main St, Portland, Or">

irb(main):005:0> a.parse => []

irb(main):006:0>

wonderchook commented 15 years ago

I have made updates to the master branch, if you could try again.

donpdonp commented 15 years ago

i updated my repo to commit 4441b9412dd6d781fa5c7733fd0eb0d2a3802ed4 Author: Kate Chapman kate@maploser.com Date: Wed Aug 26 17:59:55 2009 -0400 Support for PO Box geocoding places PO Boxes at ZIP

and tried again... irb(main):006:0> a = Geocoder::US::Address.new("100 Main St, Portland, Or") => #<Geocoder::US::Address:0x82f5418 @text="100 Main St, Portland, Or", @zip="", @plus4="", @state="OR", @number="100", @prenum=nil, @sufnum="", @street=["main st", "main saint"], @city=["portland"]> irb(main):007:0> a.parse => ["portland"]

its better but isnt parse supposed to return all elements of the address?

donpdonp commented 15 years ago

I see that the attributes in the Address object have all the address parts even though #parse does not return them, so I tried a full geocode with: irb(main):002:0> db = Geocoder::US::Database.new("/var/www/geocoder/OR_multnomah.db") => #<Geocoder::US::Database:0x83d8550 @db=#<SQLite3::Database:0x83d848c...

irb(main):003:0> p db.geocode("100 Main St, Portland, Or")

SQLite3::SQLException: no such table: feature_edge

do the database files need to be rebuilt as well?

dblue commented 15 years ago

I'm just getting familiar with this code, but I think this behavior has something to do with the missing zip code. Can you try "100 Main St, Portland, Or 97233"?