geocommons / geocoder Goto Github PK
View Code? Open in Web Editor NEWModular Street Address Geocoder
Home Page: http:///www.geocommons.com
License: GNU Lesser General Public License v3.0
Modular Street Address Geocoder
Home Page: http:///www.geocommons.com
License: GNU Lesser General Public License v3.0
Just wanted to let everyone know that this project has been translated into C# with Sql Server. All the tables and code are nearly identical, but geocoding can now be done on the windows platforms.
Here is a link: https://github.com/mb16/geocoderNet
Not sure if there is a better way to let people know about this, but please feel free to check out the code.
Michael
After importing tiger data, a feature record for "Dexter St" gets a metaphone value of "TKTR". This is confirmed by manually testing the metaphone library:
$sqlite3 /opt/tiger/geocoder.db
sqlite> .load lib/geocoder/us/sqlite3.so
sqlite> select metaphone('Dexter');
TKTR
This, compared to the results from Text::Metaphone:
$ irb
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'text'
=> true
irb(main):003:0> Text::Metaphone.metaphone 'Dexter'
=> "TXTR"
This is preventing valid addresses on Dexter St from being geocoded at the range level.
I am working on geocoding with Big Data, hence the demand for using hadoop. I currently am using jgeocoder as a jar for address parsing and geocoding on hadoop. Is there any effort on porting geocommons:geocoder on to hadoop?
With TIGER/Line 2011 data size growing, I can only imagine using hadoop would benefit the performance of the geocoder.
Current git trunk has a hardcoded name for the database rather than accepting a command line argument.
Seems there are data in db, at least query:
"SELECT * FROM feature WHERE street = '45' AND predir = 'N' AND pretyp = 'US Hwy';" returns a lot of results.
We use version from "Fri Jul 10 15:30:50 2009 +0200", because we did not succeed make full import with latest version.
There is no instructions about windows installation, only Linux. Is it even possible?
P.O. Boxes do not geocode, normally they would fail to ZIP centroid.
Examples I used:
P.O. Box 875795 Wasilla, AK 99687
PO Box 21566 Phoenix, AZ 85036
In other geocoders they revert to the centroid.
If the data has an address but no City/State the request times out. I believe in the examples below the problem is that there are many possible results.
Example data:
200 B St Indiana
100 C Street Connecticut
100 C Street Illinois
Resulting error:
SQLite3::SQLException at /
too many SQL variables
* file: errors.rb
* location: check
* line: 62
/mnt-ps/tiger/www2.census.gov/geo/tiger/TIGER2008/01_ALABAMA/01053_Escambia_County: tiger_edges tiger_featnames tiger_addr Killed
[deleted]
In trying to download a minimal set of files from http://www.census.gov/geo/www/tiger/ (for testing purposes) it isn't really clear what files need to be downloaded. For example, the directory structure seems to change in different years (a slight modification to tiger_import got it working for 2008 files, but I don't know what it was originally written for)
Importing a database from NYC HPD, we find they use the abbrevation ST for Saint in a number of cases, which causes the following address to fail:
70 ST MARKS PLACE, New York, NY 10003
But the following address succeeds:
70 SAINT MARKS PLACE, New York, NY 10003
As a work-around, we are replacing ST with SAINT if it is not the last token in the street name from the query. I'm not familiar with the internals of the geocoder, but I imagine this would be better handled at the indexing stage.
Hi all,
I have suffered through the headaches of setting this up so many times that I have incorporated the entire setup into a docker image. Find more details at the project site, including how to batch geocode and some detailed instructions for installing and using Docker.
The import_shapefile function is not defined, and the default /lib/geocoder/us/import/tiger.rb file is not setup for shapefile imports, here is my stab at it, I wasn't sure where this function belonged in the import file, or else I'd just submit a patch (that, and I'm a ruby and a TIGER newbie, so I'm not sure if it's even all correct)
def import_shapefile (file,table)
if file.match('.shp$')
insert_shapefile file, table
elsif file.match('.dbf$')
insert_dbf file, table
end
end
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>
The current README.txt file is already in .rdoc format. Just by changing the file name, the main page will be rendered in rdoc format giving it a pretty look.
Using the modified code per my previous post in the Google groups: "my DIFFS to build on AMD64/Quadcore Gentoo", I performed a "make clean" and then "make". The "make" sessions are at the end of this posting.
When I try to build the database against the Napa County set of TIGER2009 files, there are errors:
hermes geocoder # bin/tiger_import /var/work/tiger/geocoder3.db /var/work/tiger/tiger
--- /var/work/tiger/tiger/06_CALIFORNIA/06055_Napa_County
Error: bin/../lib/geocoder/us/sqlite3.so: undefined symbol: ceil
memory
Error: near line 50696: no such function: metaphone
Error: near line 50724: no such function: digit_suffix
hermes geocoder #
Here are my make sessions:
hermes geocoder # make clean
make -C src clean
make[1]: Entering directory /var/work/geocoder/src' make -C libsqlite3_geocoder clean make[2]: Entering directory
/var/work/geocoder/src/libsqlite3_geocoder'
Makefile:21: warning: overriding commands for target libsqlite3_geocoder.so' Makefile:11: warning: ignoring old commands for target
libsqlite3_geocoder.so'
Makefile:32: warning: overriding commands for target clean' Makefile:15: warning: ignoring old commands for target
clean'
rm -f _.o *.so wkb_compress levenshtein
make[2]: Leaving directory /var/work/geocoder/src/libsqlite3_geocoder' make -C liblwgeom clean make[2]: Entering directory
/var/work/geocoder/src/liblwgeom'
rm -f measures.o box2d.o ptarray.o lwgeom_api.o lwgeom.o lwpoint.o lwline.o lwpoly.o lwmpoint.o lwmline.o lwmpoly.o lwcollection.o lwcircstring.o lwcompound.o lwcurvepoly.o lwmcurve.o lwmsurface.o lwutil.o lwalgorithm.o lwgunparse.o lwgparse.o lwsegmentize.o wktparse.tab.o lex.yy.o vsprintf.o
rm -f liblwgeom.a
make[2]: Leaving directory /var/work/geocoder/src/liblwgeom' make -C shp2sqlite clean make[2]: Entering directory
/var/work/geocoder/src/shp2sqlite'
make[2]: Leaving directory /var/work/geocoder/src/shp2sqlite' make[1]: Leaving directory
/var/work/geocoder/src'
rm *.gem
hermes geocoder # make
make -C src install
make[1]: Entering directory /var/work/geocoder/src' make -C libsqlite3_geocoder make[2]: Entering directory
/var/work/geocoder/src/libsqlite3_geocoder'
Makefile:21: warning: overriding commands for target libsqlite3_geocoder.so' Makefile:11: warning: ignoring old commands for target
libsqlite3_geocoder.so'
Makefile:32: warning: overriding commands for target clean' Makefile:15: warning: ignoring old commands for target
clean'
gcc -fPIC -c -o extension.o extension.c
gcc -fPIC -c -o wkb_compress.o wkb_compress.c
gcc -fPIC -c -o util.o util.c
gcc -fPIC -c -o metaphon.o metaphon.c
metaphon.c: In function 'metaphone':
metaphon.c:47: warning: cast to pointer from integer of different size
gcc -fPIC -c -o levenshtein.o levenshtein.c
gcc -fPIC -lsqlite3 -I/usr/include -shared extension.o wkb_compress.o util.o metaphon.o levenshtein.o -o libsqlite3_geocoder.so
make[2]: Leaving directory /var/work/geocoder/src/libsqlite3_geocoder' make -C liblwgeom make[2]: Entering directory
/var/work/geocoder/src/liblwgeom'
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o measures.o measures.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o box2d.o box2d.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o ptarray.o ptarray.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwgeom_api.o lwgeom_api.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwgeom.o lwgeom.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwpoint.o lwpoint.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwline.o lwline.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwpoly.o lwpoly.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwmpoint.o lwmpoint.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwmline.o lwmline.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwmpoly.o lwmpoly.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwcollection.o lwcollection.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwcircstring.o lwcircstring.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwcompound.o lwcompound.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwcurvepoly.o lwcurvepoly.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwmcurve.o lwmcurve.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwmsurface.o lwmsurface.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwutil.o lwutil.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwalgorithm.o lwalgorithm.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwgunparse.o lwgunparse.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwgparse.o lwgparse.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwsegmentize.o lwsegmentize.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o wktparse.tab.o wktparse.tab.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lex.yy.o lex.yy.c
lex.yy.c: In function 'lwg_parse_yylex':
wktparse.lex:73: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
wktparse.lex: At top level:
lex.yy.c:4126: warning: 'yyunput' defined but not used
lex.yy.c:4167: warning: 'input' defined but not used
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o vsprintf.o vsprintf.c
ar rs liblwgeom.a measures.o box2d.o ptarray.o lwgeom_api.o lwgeom.o lwpoint.o lwline.o lwpoly.o lwmpoint.o lwmline.o lwmpoly.o lwcollection.o lwcircstring.o lwcompound.o lwcurvepoly.o lwmcurve.o lwmsurface.o lwutil.o lwalgorithm.o lwgunparse.o lwgparse.o lwsegmentize.o wktparse.tab.o lex.yy.o vsprintf.o
ar: creating liblwgeom.a
make[2]: Leaving directory /var/work/geocoder/src/liblwgeom' make -C shp2sqlite make[2]: Entering directory
/var/work/geocoder/src/shp2sqlite'
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o shpopen.o shpopen.c
shpopen.c: In function 'SHPWriteHeader':
shpopen.c:315: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
shpopen.c:325: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
shpopen.c:340: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
shpopen.c: In function 'SHPOpen':
shpopen.c:455: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
shpopen.c:465: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
shpopen.c:544: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
shpopen.c: In function 'SHPCreate':
shpopen.c:713: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
shpopen.c:722: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
shpopen.c: In function 'SHPReadObject':
shpopen.c:1325: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o dbfopen.o dbfopen.c
dbfopen.c: In function 'DBFWriteHeader':
dbfopen.c:283: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
dbfopen.c:284: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
dbfopen.c:294: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFFlushRecord':
dbfopen.c:317: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFUpdateHeader':
dbfopen.c:337: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
dbfopen.c:345: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFClose':
dbfopen.c:519: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
dbfopen.c:523: warning: ignoring return value of 'fwrite', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFWriteAttribute':
dbfopen.c:1112: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFWriteAttributeDirectly':
dbfopen.c:1281: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFWriteTuple':
dbfopen.c:1427: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
dbfopen.c: In function 'DBFReadTuple':
dbfopen.c:1471: warning: ignoring return value of 'fread', declared with attribute warn_unused_result
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o getopt.o getopt.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o shp2sqlite.o shp2sqlite.c
gcc -Iiconv -I/usr/include -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes shpopen.o dbfopen.o getopt.o shp2sqlite.o ../liblwgeom/liblwgeom.a -lc -lm -o shp2sqlite
make[2]: Leaving directory /var/work/geocoder/src/shp2sqlite' cp libsqlite3_geocoder/_.so ../lib/geocoder/us/sqlite3.so make -C shp2sqlite install make[2]: Entering directory
/var/work/geocoder/src/shp2sqlite'
make[2]: Leaving directory/var/work/geocoder/src/shp2sqlite' make[1]: Leaving directory
/var/work/geocoder/src'
gem build gemspec
WARNING: no rubyforge_project specified
WARNING: description and summary are identical
Successfully built RubyGem
Name: Geocoder-US
Version: 2.0.0
File: Geocoder-US-2.0.0.gem
hermes geocoder #
On Fedora 15/64 yacc throws an error in 20th line of wktparse.y:
--- cut here ---
yacc -vd -p lwg_parse_yy wktparse.y
yacc: e - line 20 of "wktparse.y", syntax error
%locations
^
make[2]: *** [wktparse.tab.c] Error 1
--- cut here ---
This is the build log:
--- cut here ---
[jacek@dragon32 geocoder]$ make
make -C src install
make[1]: Entering directory /home/jacek/devel/ruby/geocoder/geocoder/src' make -C libsqlite3_geocoder make[2]: Entering directory
/home/jacek/devel/ruby/geocoder/geocoder/src/libsqlite3_geocoder'
Makefile:11: warning: overriding recipe for target libsqlite3_geocoder.so' Makefile:4: warning: ignoring old recipe for target
libsqlite3_geocoder.so'
Makefile:22: warning: overriding recipe for target clean' Makefile:8: warning: ignoring old recipe for target
clean'
gcc -fPIC -c -o extension.o extension.c
gcc -fPIC -c -o wkb_compress.o wkb_compress.c
gcc -fPIC -c -o util.o util.c
gcc -fPIC -c -o metaphon.o metaphon.c
gcc -fPIC -c -o levenshtein.o levenshtein.c
gcc -fPIC -lsqlite3 -lm -I/usr/include -shared extension.o wkb_compress.o util.o metaphon.o levenshtein.o -o libsqlite3_geocoder.so
make[2]: Leaving directory /home/jacek/devel/ruby/geocoder/geocoder/src/libsqlite3_geocoder' make -C liblwgeom make[2]: Entering directory
/home/jacek/devel/ruby/geocoder/geocoder/src/liblwgeom'
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o measures.o measures.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o box2d.o box2d.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o ptarray.o ptarray.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwgeom_api.o lwgeom_api.c
lwgeom_api.c: In function ‘lwgeom_getgeom_inspected’:
lwgeom_api.c:1181:8: warning: variable ‘type’ set but not used [-Wunused-but-set-variable]
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwgeom.o lwgeom.c
lwgeom.c: In function ‘lwgeom_to_ewkt’:
lwgeom.c:492:6: warning: variable ‘result’ set but not used [-Wunused-but-set-variable]
lwgeom.c: In function ‘lwgeom_to_hexwkb’:
lwgeom.c:512:6: warning: variable ‘result’ set but not used [-Wunused-but-set-variable]
lwgeom.c: In function ‘lwgeom_to_ewkb’:
lwgeom.c:528:6: warning: variable ‘result’ set but not used [-Wunused-but-set-variable]
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwpoint.o lwpoint.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwline.o lwline.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwpoly.o lwpoly.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwmpoint.o lwmpoint.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwmline.o lwmline.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwmpoly.o lwmpoly.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwcollection.o lwcollection.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwcircstring.o lwcircstring.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwcompound.o lwcompound.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwcurvepoly.o lwcurvepoly.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwmcurve.o lwmcurve.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwmsurface.o lwmsurface.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwutil.o lwutil.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwalgorithm.o lwalgorithm.c
lwalgorithm.c: In function ‘lwline_crossing_direction’:
lwalgorithm.c:150:6: warning: variable ‘final_cross’ set but not used [-Wunused-but-set-variable]
lwalgorithm.c:140:20: warning: variable ‘rv’ set but not used [-Wunused-but-set-variable]
lwalgorithm.c: In function ‘lwline_clip_to_ordinate_range’:
lwalgorithm.c:481:9: warning: variable ‘rv’ set but not used [-Wunused-but-set-variable]
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwgunparse.o lwgunparse.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwgparse.o lwgparse.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o lwsegmentize.o lwsegmentize.c
yacc -vd -p lwg_parse_yy wktparse.y
yacc: e - line 20 of "wktparse.y", syntax error
%locations
^
make[2]: *** [wktparse.tab.c] Error 1
make[2]: Leaving directory /home/jacek/devel/ruby/geocoder/geocoder/src/liblwgeom' make[1]: *** [all] Error 2 make[1]: Leaving directory
/home/jacek/devel/ruby/geocoder/geocoder/src'
make: *** [all] Error 2
--- cut here ---
After building, the README says to run bin/tiger_import, but the only tiger_import file is actually in build (and apparently everything in build should be in bin)
The current readme is not comprehensive enough to get a working geocoder going.
It'd be great to have better and more detailed instructions on which Tiger/Line datasets to download and what else needs to be done to proceed from start to finish.
I imported whole TIGER data array.
All requests are extremely slow.
Hi!
I was merrily going about generating the geocoder.db file and I happened to download Tiger/Line 2011:
ftp://ftp2.census.gov/geo/tiger/TIGER2011/
It built successfully and I was able to install the gem. I went on to try to generate the data file as the README says and:
development:jjeffus@~/dev/geocoder[master]: build/tiger_import ~/geocoder.db /Volumes/Blimpy/TigerLine/
ls: /Volumes/Blimpy/TigerLine////tl_*_edges.zip: No such file or directory
Seeing a tiger2009_import I figured maybe things had changed and the readme hadn't been updated. So:
development:jjeffus@~/dev/geocoder[master]: build/tiger2009_import ~/geocoder.db /Volumes/Blimpy/TigerLine/
ls: /Volumes/Blimpy/TigerLine//[0-9]*: No such file or directory
I'm guessing that the directory structure has changed again? The script definitely is expecting a very different structure. I'm poking around trying to figure out how to change the script. But obviously someone has had this problem before. So maybe it's a futile cause? Has it changed so significantly that it would require a complete rewrite?
This is the error message that I'm getting
~/geocoder# bin/tiger_import
bin/tiger_import:3:in `require': no such file to load -- geocoder/us/import/tiger (LoadError)
from bin/tiger_import:3
I ran make install
so the gem should be available system-wide.
If I add the full path to tiger_import:3 it works, but the default install as suggested by Readme.txt isn't working for me.
Hi. Thanks for providing this package.
When trying to import the tiger shapefiles I was getting this error:
./lib/geocoder/us/import.rb:157:in join': can't convert false into String (TypeError) from ./lib/geocoder/us/import.rb:157:in
import_tree'
from bin/tiger_import:9
from bin/tiger_import:7:in `each'
from bin/tiger_import:7
It appears there was a typo in lib/geocoder/us/import.rb. I changed the following line:
if Dir[File.join(root, !tables.values[0])].empty?
to
if !Dir[File.join(root, tables.values[0])].empty?
This seems to fix the problem for me. Hopefully this can be updated.
J
In situations where City/ZIP are missing address are coding in other states
200 West St WA : 73.90% Match but codes to 200 Sand Rd Lake, MS 39092
200 Oak Ln WA : 77.60% Match but codes to 198 Oak St Canton, MS 39046
10 Half Street NC : 70.90% Match but codes to 500 Hallview Rd Bowling Green, KY 42101
100 C Street Illionis : 100 W K St Chamberlain, SD 57325
These should probably fail or have a lower match rate.
Address with "1/2" in their street address fail. I realize this is sort of an outlier.
55 4 1/2 Street Highlands, North Carolina 28741
613 Twenty Four & 1/2 St, Winston Salem, NC 27105
715 W 22nd 1/2 St #201, Austin TX 78705
Hi,
I'm having an issue with the geocoder on where it places the point along a segment. For example, the address '5304 w port au prince ln, Glendale AZ 85306' places the point on the west end of the segment versus the east end. We have confirmed this on a number of other cases and it appears that the geocoder does not take into account the direction of the segment in the interpolation so along a segment, the points appear mirror opposites of where they should be.
This is running on Kubuntu with a build of the 2009 Tiger files
Any help with this is appreciated
Thanks
I am on OS X Lion (or leopard). I have sqlite3 - (SQLite version 3.7.5) - installed at /usr/bin/sqlite3, and sqlite3, sqlite3-ruby and Text gems installed.
I have downloaded what I believe to be the required Census 2010 files- EDGES, FEATNAMES, ADDR, ADDRFN - and placed them in opt/tiger/TIGER2010/
When I run build/tiger_import, I get the following error:
$ build/tiger_import /opt/tiger/geocoder.db /opt/tiger
--- 01001
Error: unknown command or invalid arguments: "load". Enter ".help" for help
memory
Error: near line 49538: no such function: metaphone
Error: near line 49559: no such function: compress_wkb_line
Error: near line 49566: no such function: digit_suffix
geocoder.db is created in opt/tiger but looks to be only the table structure.
I understand that this is probably an OS X issue, our target platform is ubuntu, but I was looking at taking advantage of my eight cores before moving the db to a server slice.
Any assistance would be greatly appreciated.
ruby 1.9 chokes on constants.rb because two lines have unicode multibyte characters.
irb(main):001:0> require 'geocoder/us'
WARNING: Couldn't find the fast C implementation of Levenshtein.distance. Using the much slower Ruby version instead.
SyntaxError: /var/www/geocoder/geocoder/lib/geocoder/us/constants.rb:123: invalid multibyte char (US-ASCII)
/var/www/geocoder/geocoder/lib/geocoder/us/constants.rb:123: invalid multibyte char (US-ASCII)
/var/www/geocoder/geocoder/lib/geocoder/us/constants.rb:123: syntax error, unexpected $end, expecting tASSOC
"Callejón" => "Callejón",
this can be fixed with the 'magic comment' for utf-8.
--- a/lib/geocoder/us/constants.rb
+++ b/lib/geocoder/us/constants.rb
@@ -1,3 +1,4 @@
+# coding: utf-8
require 'set'
require 'geocoder/us/numbers'
Upon running make on CentOS 5.6 base install produces the following error: iconv is located in /usr/local/lib/ruby/gems/1.9.1/gems/iconv-0.1/ext/iconv and /usr/bin/iconv
make[2]: Leaving directory /root/geocommons/geocoder/src/liblwgeom' make -C shp2sqlite make[2]: Entering directory
/root/geocommons/geocoder/src/shp2sqlite'
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o shpopen.o shpopen.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o dbfopen.o dbfopen.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o getopt.o getopt.c
gcc -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes -c -o shp2sqlite.o shp2sqlite.c
gcc -L/usr/local/libiconv/lib/ -liconv -I/usr/include -g -O2 -fPIC -DPIC -Wall -Wmissing-prototypes shpopen.o dbfopen.o getopt.o shp2sqlite.o ../liblwgeom/liblwgeom.a -lc -lm -o shp2sqlite
/usr/bin/ld: cannot find -liconv
collect2: ld returned 1 exit status
make[2]: *** [shp2sqlite] Error 1
make[2]: Leaving directory /root/geocommons/geocoder/src/shp2sqlite' make[1]: *** [all] Error 2 make[1]: Leaving directory
/root/geocommons/geocoder/src'
make: *** [all] Error 2
Hello,
I've been trying to install geocommons/geocoder on Centos 5.6. I have the following census files in my data directory: TIGER2011/ADDR, TIGER2011/FEATNAMES, and TIGER2011/EDGES. When I do : build/tiger_import database/geocoder.sqlite3 data, it works for a while but then I get:
memory
/tmp/tiger-import.10244/__addr.dbf: dbf file (.dbf) can not be opened
--- 78020
memory
/tmp/tiger-import.10244/__addr.dbf: dbf file (.dbf) can not be opened
--- 78030
memory
/tmp/tiger-import.10244/*_addr.dbf: dbf file (.dbf) can not be opened
Can someone please tell me why I get this error and how to fix it?
Thank you.
I'm trying to compile this on OS X, I have the dependencies, but when I run make I get:
make -C src install
make -C libsqlite3_geocoder
cc -shared extension.o wkb_compress.o util.o metaphon.o -o libsqlite3_geocoder.so
Undefined symbols:
"_sqlite3_malloc", referenced from:
_metaphone in metaphon.o
"_main", referenced from:
start in crt1.10.5.o
"_sqlite3_free", referenced from:
_metaphone in metaphon.o
_metaphone in metaphon.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [libsqlite3_geocoder.so] Error 1
make[1]: *** [all] Error 2
make: *** [all] Error 2
I recently forked this project to make some improvements in the zip code lookups and in street matching. For the latter I utilized the sqlite spellfix library which has much better spelling performance than the metaphones currently in the project. This permits successful matches where there are larger discrepancies in the spellings. I also modified the zip code search to look at all zip codes in the county of the original zip code, rather than just dropping the last two digits. This manages to search the most likely zip codes, and certainly those adjacent to the original zip code in that event that it was changed at some point in the past (this is more useful when working with old addresses). Also, I introduced some thresholds to induce further lookups if poor matches were returned. Please feel free to utilize this fork and contact me if there are errors, or if clarification is needed. The readme contains a longer description of the changes as well as instructions to compile the spellfix library and load the data.
https://github.com/mb16/geocoder
hermes geocoder # make clean
make -C src clean
make[1]: Entering directory /var/work/geocoder/src' make -C libsqlite3_geocoder clean make[2]: Entering directory
/var/work/geocoder/src/libsqlite3_geocoder'
Makefile:11: warning: overriding commands for target libsqlite3_geocoder.so' Makefile:4: warning: ignoring old commands for target
libsqlite3_geocoder.so'
Makefile:22: warning: overriding commands for target clean' Makefile:8: warning: ignoring old commands for target
clean'
rm -f _.o *.so wkb_compress levenshtein
make[2]: Leaving directory /var/work/geocoder/src/libsqlite3_geocoder' make -C liblwgeom clean make[2]: Entering directory
/var/work/geocoder/src/liblwgeom'
rm -f measures.o box2d.o ptarray.o lwgeom_api.o lwgeom.o lwpoint.o lwline.o lwpoly.o lwmpoint.o lwmline.o lwmpoly.o lwcollection.o lwcircstring.o lwcompound.o lwcurvepoly.o lwmcurve.o lwmsurface.o lwutil.o lwalgorithm.o lwgunparse.o lwgparse.o lwsegmentize.o wktparse.tab.o lex.yy.o vsprintf.o
rm -f liblwgeom.a
make[2]: Leaving directory /var/work/geocoder/src/liblwgeom' make -C shp2sqlite clean make[2]: Entering directory
/var/work/geocoder/src/shp2sqlite'
make[2]: Leaving directory /var/work/geocoder/src/shp2sqlite' make[1]: Leaving directory
/var/work/geocoder/src'
rm *.gem
rm: cannot remove _.gem': No such file or directory make: **\* [clean] Error 1 hermes geocoder # hermes geocoder # pwd /var/work/geocoder hermes geocoder # make make -C src install make[1]: Entering directory
/var/work/geocoder/src'
make -C libsqlite3_geocoder
make[2]: Entering directory/var/work/geocoder/src/libsqlite3_geocoder' Makefile:11: warning: overriding commands for target
libsqlite3_geocoder.so'
Makefile:4: warning: ignoring old commands for targetlibsqlite3_geocoder.so' Makefile:22: warning: overriding commands for target
clean'
Makefile:8: warning: ignoring old commands for targetclean' gcc-4.2 -c -o extension.o extension.c make[2]: gcc-4.2: Command not found make[2]: **\* [extension.o] Error 127 make[2]: Leaving directory
/var/work/geocoder/src/libsqlite3_geocoder'
make[1]: *** [all] Error 2
make[1]: Leaving directory`/var/work/geocoder/src'
make: *** [all] Error 2
hermes geocoder #
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.