http://groups.google.com/group/geocommons-geocode/browse_thread/thread/c8443c08e383d84a
I'm only interested, for now, in Rhode Island addresses, so I
downloaded the 44_RHODE_ISLAND tiger directory. Here's the output of
tiger_import:
root@domU-12-31-39-09-14-45:~/geocoder# bin/tiger_import /opt/tiger/
geocoder.db /opt/tiger
--- /opt/tiger/44_RHODE_ISLAND/44001_Bristol_County
bin/../lib/geocoder/us/sqlite3.so: undefined symbol: ceil
memory
SQL error near line 16070: no such function: metaphone
SQL error near line 16098: no such function: digit_suffix
--- /opt/tiger/44_RHODE_ISLAND/44003_Kent_County
bin/../lib/geocoder/us/sqlite3.so: undefined symbol: ceil
memory
SQL error near line 66513: no such function: metaphone
SQL error near line 66541: no such function: digit_suffix
--- /opt/tiger/44_RHODE_ISLAND/44005_Newport_County
bin/../lib/geocoder/us/sqlite3.so: undefined symbol: ceil
memory
SQL error near line 35871: no such function: metaphone
SQL error near line 35899: no such function: digit_suffix
--- /opt/tiger/44_RHODE_ISLAND/44007_Providence_County
bin/../lib/geocoder/us/sqlite3.so: undefined symbol: ceil
memory
SQL error near line 188827: no such function: metaphone
SQL error near line 188855: no such function: digit_suffix
--- /opt/tiger/44_RHODE_ISLAND/44009_Washington_County
bin/../lib/geocoder/us/sqlite3.so: undefined symbol: ceil
memory
SQL error near line 77369: no such function: metaphone
SQL error near line 77397: no such function: digit_suffix
Now, the geocoder works, but only returns city level results:
root@domU-12-31-39-09-14-45:~# irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'geocoder/us'
=> true
irb(main):003:0> db = Geocoder::US::Database.new("/opt/tiger/
geocoder.db")
=> #<Geocoder::US::Database:0xb72876a4 @debug=false, @st={},
@threadsafe=false, @db=#<SQLite3::Database:0xb728762c @closed=false,
@translator=nil, @type_translation=false,
@driver=#<SQLite3::Driver::Native::Driver:0xb7287410 @busy_handler={},
@authorizer={},
@callback_data={"digit_suffix"=>#<SQLite3::Driver::Native::API::CallbackData:
0xb727123c>, "metaphone"=>#<SQLite3::Driver::Native::API::CallbackData:
0xb727132c>,
"nondigit_prefix"=>#<SQLite3::Driver::Native::API::CallbackData:
0xb72712b4>,
"levenshtein"=>#<SQLite3::Driver::Native::API::CallbackData:
0xb72713a4>}, @trace={}>, @statement_factory=SQLite3::Statement,
@results_as_hash=false, @handle=#<SWIG::TYPE_p_sqlite3:0xb727687c>,
@transaction_active=false>>
irb(main):011:0> p db.geocode("25 Dorrance St, Providence, RI")
zip results 2
[{:fips_county=>"44007", :lon=>"-71.412834", :city=>"Providence", :precision=>:city, :lat=>"41.823989", :score=>0.528, :zip=>"02913", :state=>"RI"}]
This makes me think the RI tiger files didn't import correctly, and
this had something to do with the metaphone and digit_suffix SQL
errors. Is the metaphone library not being loaded properly?
Thanks for any help!
Peter
On Apr 9, 7:04 am, Peter <peter.lan...@gmail.com> wrote:
> Hello!
> I've built the geocoder on an Ubuntu 9.1 machine. I basically followed
> these exact directions:
>
> http://groups.google.com/group/geocommons-geocode/browse_thread/threa...
sqlite> .load /root/geocoder/lib/geocoder/us/sqlite3.so
/root/geocoder/lib/geocoder/us/sqlite3.so: undefined symbol: ceil
sqlite> select metaphone('test');
SQL error: no such function: metaphone
I see there's an open ticket for the ceil issue already (http://
github.com/geocommons/geocoder/issues#issue/16), but no resolution
yet. I'm assuming that's the root of my issue? I tried testing ceil()
in a program, and it compiles and runs properly for me, so I'm not
sure why extension.o is having trouble.
Peter
On Apr 9, 11:41 am, Peter <peter.lan...@gmail.com> wrote:
<snip>
>
> sqlite> .load /root/geocoder/lib/geocoder/us/sqlite3.so
> /root/geocoder/lib/geocoder/us/sqlite3.so: undefined symbol: ceil
<snip>
all: libsqlite3_geocoder.so
CFLAGS=-fPIC
libsqlite3_geocoder.so: extension.o wkb_compress.o util.o metaphon.o
levenshtein.o
$(CC) $(CFLAGS) -lm -shared $^ -o $@
test: test_wkb_compress test_levenshtein
test_wkb_compress: wkb_compress.c
$(CC) -DTEST -o wkb_compress $^
test_levenshtein: levenshtein.c
$(CC) -DTEST -o levenshtein $^
clean:
rm -f *.o *.so wkb_compress levenshtein
After I made this change, the module compiled correctly, and the tiger
data for Rhode Island imported "correctly." I don't yet know enough to
say if this is specific to Ubuntu systems, but if it is would shipping
a Makefile.ubuntu be appropriate? Or should '-lm' be added to other
Makefiles?
Hope this helps,
Peter
PS - I say "correctly" because the geocode method returns a result
properly, but I'm getting lat/lng results in what looks like feet or
meters, so I may still have some kind of projection issue to track
down.