geo_coder 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile +12 -0
- data/Gemfile.lock +32 -0
- data/History.txt +6 -0
- data/Makefile +13 -0
- data/Manifest.txt +18 -0
- data/README.rdoc +197 -0
- data/Rakefile +53 -0
- data/TODO.txt +8 -0
- data/VERSION +1 -0
- data/bin/build_indexes +8 -0
- data/bin/rebuild_cluster +22 -0
- data/bin/rebuild_metaphones +23 -0
- data/bin/tiger_import +59 -0
- data/demos/demo/app/ext/geocodewrap.rb +84 -0
- data/demos/demo/app/views/index.builder +13 -0
- data/demos/demo/app/views/index.erb +71 -0
- data/demos/demo/config.ru +12 -0
- data/demos/demo/config/bootstraps.rb +130 -0
- data/demos/demo/config/geoenvironment.rb +25 -0
- data/demos/demo/geocoder_helper.rb +12 -0
- data/demos/demo/geocom_geocode.rb +10 -0
- data/demos/demo/main.rb +3 -0
- data/demos/demo/rakefile.rb +17 -0
- data/demos/demo/tmp/restart.txt +0 -0
- data/demos/simpledemo/views/index.builder +13 -0
- data/demos/simpledemo/views/index.erb +69 -0
- data/demos/simpledemo/ws.rb +83 -0
- data/doc/Makefile +7 -0
- data/doc/html4css1.css +279 -0
- data/doc/lookup.rst +193 -0
- data/doc/parsing.rst +125 -0
- data/doc/voidspace.css +147 -0
- data/geo_coder.gemspec +172 -0
- data/lib/geocoder/us.rb +21 -0
- data/lib/geocoder/us/address.rb +290 -0
- data/lib/geocoder/us/constants.rb +670 -0
- data/lib/geocoder/us/database.rb +745 -0
- data/lib/geocoder/us/import.rb +181 -0
- data/lib/geocoder/us/import/tiger.rb +13 -0
- data/lib/geocoder/us/numbers.rb +58 -0
- data/navteq/README +4 -0
- data/navteq/convert.sql +37 -0
- data/navteq/navteq_import +39 -0
- data/navteq/prepare.sql +92 -0
- data/sql/cluster.sql +16 -0
- data/sql/convert.sql +80 -0
- data/sql/create.sql +37 -0
- data/sql/index.sql +12 -0
- data/sql/place.csv +104944 -0
- data/sql/place.sql +104948 -0
- data/sql/setup.sql +78 -0
- data/src/Makefile +13 -0
- data/src/README +14 -0
- data/src/liblwgeom/Makefile +75 -0
- data/src/liblwgeom/box2d.c +54 -0
- data/src/liblwgeom/lex.yy.c +4799 -0
- data/src/liblwgeom/liblwgeom.h +1405 -0
- data/src/liblwgeom/lwalgorithm.c +946 -0
- data/src/liblwgeom/lwalgorithm.h +52 -0
- data/src/liblwgeom/lwcircstring.c +759 -0
- data/src/liblwgeom/lwcollection.c +541 -0
- data/src/liblwgeom/lwcompound.c +118 -0
- data/src/liblwgeom/lwcurvepoly.c +86 -0
- data/src/liblwgeom/lwgeom.c +886 -0
- data/src/liblwgeom/lwgeom_api.c +2201 -0
- data/src/liblwgeom/lwgparse.c +1219 -0
- data/src/liblwgeom/lwgunparse.c +1054 -0
- data/src/liblwgeom/lwline.c +525 -0
- data/src/liblwgeom/lwmcurve.c +125 -0
- data/src/liblwgeom/lwmline.c +137 -0
- data/src/liblwgeom/lwmpoint.c +138 -0
- data/src/liblwgeom/lwmpoly.c +141 -0
- data/src/liblwgeom/lwmsurface.c +129 -0
- data/src/liblwgeom/lwpoint.c +439 -0
- data/src/liblwgeom/lwpoly.c +579 -0
- data/src/liblwgeom/lwsegmentize.c +1047 -0
- data/src/liblwgeom/lwutil.c +369 -0
- data/src/liblwgeom/measures.c +861 -0
- data/src/liblwgeom/postgis_config.h +93 -0
- data/src/liblwgeom/ptarray.c +847 -0
- data/src/liblwgeom/vsprintf.c +179 -0
- data/src/liblwgeom/wktparse.h +126 -0
- data/src/liblwgeom/wktparse.lex +74 -0
- data/src/liblwgeom/wktparse.tab.c +2353 -0
- data/src/liblwgeom/wktparse.tab.h +145 -0
- data/src/liblwgeom/wktparse.y +385 -0
- data/src/libsqlite3_geocoder/Makefile +22 -0
- data/src/libsqlite3_geocoder/Makefile.nix +15 -0
- data/src/libsqlite3_geocoder/Makefile.redhat +15 -0
- data/src/libsqlite3_geocoder/extension.c +121 -0
- data/src/libsqlite3_geocoder/extension.h +13 -0
- data/src/libsqlite3_geocoder/levenshtein.c +42 -0
- data/src/libsqlite3_geocoder/metaphon.c +278 -0
- data/src/libsqlite3_geocoder/util.c +37 -0
- data/src/libsqlite3_geocoder/wkb_compress.c +54 -0
- data/src/metaphone/Makefile +7 -0
- data/src/metaphone/README +49 -0
- data/src/metaphone/extension.c +37 -0
- data/src/metaphone/metaphon.c +251 -0
- data/src/shp2sqlite/Makefile +37 -0
- data/src/shp2sqlite/Makefile.nix +36 -0
- data/src/shp2sqlite/Makefile.redhat +35 -0
- data/src/shp2sqlite/dbfopen.c +1595 -0
- data/src/shp2sqlite/getopt.c +695 -0
- data/src/shp2sqlite/getopt.h +127 -0
- data/src/shp2sqlite/shapefil.h +500 -0
- data/src/shp2sqlite/shp2sqlite.c +1974 -0
- data/src/shp2sqlite/shpopen.c +1894 -0
- data/tests/address.rb +236 -0
- data/tests/benchmark.rb +20 -0
- data/tests/constants.rb +57 -0
- data/tests/data/address-sample.csv +52 -0
- data/tests/data/db-test.csv +57 -0
- data/tests/data/locations.csv +4 -0
- data/tests/database.rb +137 -0
- data/tests/generate.rb +34 -0
- data/tests/numbers.rb +46 -0
- data/tests/run.rb +11 -0
- metadata +237 -0
data/doc/parsing.rst
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
.. _parsing:
|
|
2
|
+
|
|
3
|
+
====================================
|
|
4
|
+
Geocoder.us Address Parsing Strategy
|
|
5
|
+
====================================
|
|
6
|
+
|
|
7
|
+
:Author: Schuyler Erle
|
|
8
|
+
:Contact: schuyler at geocoder dot us
|
|
9
|
+
:Created: 2009/03/18
|
|
10
|
+
:Edited: 2009/03/18
|
|
11
|
+
|
|
12
|
+
Structured address components
|
|
13
|
+
-----------------------------
|
|
14
|
+
|
|
15
|
+
Unless otherwise labeled as "required", all components of a structured address
|
|
16
|
+
are optional.
|
|
17
|
+
|
|
18
|
+
prenum
|
|
19
|
+
The alphanumeric prefix portion of a house or building number. (e.g. "32-"
|
|
20
|
+
in "32-20 Jackson St".
|
|
21
|
+
|
|
22
|
+
number
|
|
23
|
+
The house or building number component. Required.
|
|
24
|
+
|
|
25
|
+
sufnum
|
|
26
|
+
The alphanumeric suffix portion of a house or building number. (e.g. "23B
|
|
27
|
+
Baker St")
|
|
28
|
+
|
|
29
|
+
fraction
|
|
30
|
+
The fractional portion of a house or building number. (e.g. "23 1/2 Baker
|
|
31
|
+
St")
|
|
32
|
+
|
|
33
|
+
predir
|
|
34
|
+
The prefixed street directional component. (e.g. "N", "SW")
|
|
35
|
+
|
|
36
|
+
prequal
|
|
37
|
+
The prefixed street qualifier component. (e.g. "Old", "Business")
|
|
38
|
+
|
|
39
|
+
pretyp
|
|
40
|
+
The prefixed street type component. (e.g. "US Hwy")
|
|
41
|
+
|
|
42
|
+
street
|
|
43
|
+
The main portion of the street name. Required.
|
|
44
|
+
|
|
45
|
+
suftyp
|
|
46
|
+
The suffixed street type component. (e.g. "Rd", "Ave")
|
|
47
|
+
|
|
48
|
+
sufqual
|
|
49
|
+
The suffixed street qualifier component.
|
|
50
|
+
|
|
51
|
+
sufdir
|
|
52
|
+
The suffixed street directional component.
|
|
53
|
+
|
|
54
|
+
unittyp
|
|
55
|
+
The unit type, if any. (e.g. "Fl", "Apt", "Ste")
|
|
56
|
+
|
|
57
|
+
unit
|
|
58
|
+
The unit identifer, if any.
|
|
59
|
+
|
|
60
|
+
city
|
|
61
|
+
The name of the city or locale.
|
|
62
|
+
|
|
63
|
+
state
|
|
64
|
+
The two letter postal state code.
|
|
65
|
+
|
|
66
|
+
zip
|
|
67
|
+
The zero padded, five digit ZIP postal code.
|
|
68
|
+
|
|
69
|
+
plus4
|
|
70
|
+
The zero padded, four digit ZIP+4 postal extension.
|
|
71
|
+
|
|
72
|
+
Parsing Strategy
|
|
73
|
+
----------------
|
|
74
|
+
|
|
75
|
+
Each component will have a regular expression, and a maximum
|
|
76
|
+
count. Components are ordered from first to last.
|
|
77
|
+
|
|
78
|
+
Those components drawn from finite lists - directionals, qualifiers,
|
|
79
|
+
types, and states - will have regular expressions composed of the union of
|
|
80
|
+
the corresponding list.
|
|
81
|
+
|
|
82
|
+
A *parse* will consist of a component state, a penalty count, a list of
|
|
83
|
+
component strings and a counter for each component.
|
|
84
|
+
|
|
85
|
+
1. Initialize an input stack, consisting of a single blank parse.
|
|
86
|
+
|
|
87
|
+
#. Split the address string on whitespace into tokens.
|
|
88
|
+
|
|
89
|
+
#. For each token:
|
|
90
|
+
|
|
91
|
+
A. For each component:
|
|
92
|
+
|
|
93
|
+
i. Test the token against the regular expression.
|
|
94
|
+
#. If the regexp matches, add the component name to a list of matching
|
|
95
|
+
components.
|
|
96
|
+
|
|
97
|
+
#. Initialize an empty output stack.
|
|
98
|
+
|
|
99
|
+
#. For each parse in the input stack:
|
|
100
|
+
|
|
101
|
+
i. Copy the current parse, increment the penalty count on the new parse,
|
|
102
|
+
and add it to the output stack.
|
|
103
|
+
#. For each matching component for the current token:
|
|
104
|
+
|
|
105
|
+
a. If the component state for this parse is later than the
|
|
106
|
+
matching component, continue to the next matching component.
|
|
107
|
+
#. If the component count for this parse state is equal to the
|
|
108
|
+
maximum count for the component, continue to the next matching
|
|
109
|
+
component.
|
|
110
|
+
#. Otherwise, copy the parse state, and append the token to the
|
|
111
|
+
component string, with a leading space, if necessary.
|
|
112
|
+
#. Increment the matching component counter for the current parse.
|
|
113
|
+
#. Set the component state of the current parse to the matching
|
|
114
|
+
component.
|
|
115
|
+
#. Push the new parse on to the output stack.
|
|
116
|
+
|
|
117
|
+
#. Replace the input stack with the output stack.
|
|
118
|
+
|
|
119
|
+
#. Post-process number prefix/suffixes and ZIP+4 extensions.
|
|
120
|
+
|
|
121
|
+
#. Score each parse by the number of components with non-empty strings,
|
|
122
|
+
minus the penalty count of the parse.
|
|
123
|
+
|
|
124
|
+
#. Return the sorted list of parsed string lists.
|
|
125
|
+
|
data/doc/voidspace.css
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/*
|
|
2
|
+
:Authors: Ian Bicking, Michael Foord
|
|
3
|
+
:Contact: fuzzyman@voidspace.org.uk
|
|
4
|
+
:Date: 2005/08/26
|
|
5
|
+
:Version: 0.1.0
|
|
6
|
+
:Copyright: This stylesheet has been placed in the public domain.
|
|
7
|
+
:Modified By: Schuyler Erle, for geocoder.us, 2008-03-14
|
|
8
|
+
|
|
9
|
+
Stylesheet for Docutils.
|
|
10
|
+
Based on ``blue_box.css`` by Ian Bicking
|
|
11
|
+
and ``html4css1.css`` revision 1.46.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
@import url(html4css1.css);
|
|
15
|
+
|
|
16
|
+
/* changes made by SDE */
|
|
17
|
+
body {
|
|
18
|
+
font-family: Arial, sans-serif;
|
|
19
|
+
margin-left: 10%;
|
|
20
|
+
margin-right: 10%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
p { text-align: justify; }
|
|
24
|
+
dt { font-style: italic; }
|
|
25
|
+
/* end changes */
|
|
26
|
+
|
|
27
|
+
em, i {
|
|
28
|
+
/* Typically serif fonts have much nicer italics */
|
|
29
|
+
font-family: Times New Roman, Times, serif;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
a.target {
|
|
33
|
+
color: blue;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
a.target {
|
|
37
|
+
color: blue;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
a.toc-backref {
|
|
41
|
+
text-decoration: none;
|
|
42
|
+
color: black;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
a.toc-backref:hover {
|
|
46
|
+
background-color: inherit;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
a:hover {
|
|
50
|
+
background-color: #cccccc;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
div.attention, div.caution, div.danger, div.error, div.hint,
|
|
54
|
+
div.important, div.note, div.tip, div.warning {
|
|
55
|
+
background-color: #cccccc;
|
|
56
|
+
padding: 3px;
|
|
57
|
+
width: 80%;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
div.admonition p.admonition-title, div.hint p.admonition-title,
|
|
61
|
+
div.important p.admonition-title, div.note p.admonition-title,
|
|
62
|
+
div.tip p.admonition-title {
|
|
63
|
+
text-align: center;
|
|
64
|
+
background-color: #999999;
|
|
65
|
+
display: block;
|
|
66
|
+
margin: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
div.attention p.admonition-title, div.caution p.admonition-title,
|
|
70
|
+
div.danger p.admonition-title, div.error p.admonition-title,
|
|
71
|
+
div.warning p.admonition-title {
|
|
72
|
+
color: #cc0000;
|
|
73
|
+
font-family: sans-serif;
|
|
74
|
+
text-align: center;
|
|
75
|
+
background-color: #999999;
|
|
76
|
+
display: block;
|
|
77
|
+
margin: 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
h1, h2, h3, h4, h5, h6 {
|
|
81
|
+
font-family: Helvetica, Arial, sans-serif;
|
|
82
|
+
border: thin solid black;
|
|
83
|
+
/* This makes the borders rounded on Mozilla, which pleases me */
|
|
84
|
+
-moz-border-radius: 8px;
|
|
85
|
+
padding: 4px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
h1 {
|
|
89
|
+
background-color: #444499;
|
|
90
|
+
color: #ffffff;
|
|
91
|
+
border: medium solid black;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
h1 a.toc-backref, h2 a.toc-backref {
|
|
95
|
+
color: #ffffff;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
h2 {
|
|
99
|
+
background-color: #666666;
|
|
100
|
+
color: #ffffff;
|
|
101
|
+
border: medium solid black;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
h3, h4, h5, h6 {
|
|
105
|
+
background-color: #cccccc;
|
|
106
|
+
color: #000000;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
h3 a.toc-backref, h4 a.toc-backref, h5 a.toc-backref,
|
|
110
|
+
h6 a.toc-backref {
|
|
111
|
+
color: #000000;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
h1.title {
|
|
115
|
+
text-align: center;
|
|
116
|
+
background-color: #444499;
|
|
117
|
+
color: #eeeeee;
|
|
118
|
+
border: thick solid black;
|
|
119
|
+
-moz-border-radius: 20px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
table.footnote {
|
|
123
|
+
padding-left: 0.5ex;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
table.citation {
|
|
127
|
+
padding-left: 0.5ex
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
pre.literal-block, pre.doctest-block {
|
|
131
|
+
border: thin black solid;
|
|
132
|
+
padding: 5px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.image img { border-style : solid;
|
|
136
|
+
border-width : 2px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
|
|
140
|
+
font-size: 100%;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
code, tt {
|
|
144
|
+
color: #000066;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
data/geo_coder.gemspec
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Generated by jeweler
|
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
|
+
# -*- encoding: utf-8 -*-
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |s|
|
|
7
|
+
s.name = "geo_coder"
|
|
8
|
+
s.version = "0.1.0"
|
|
9
|
+
|
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
|
+
s.authors = ["Travis Dempsey"]
|
|
12
|
+
s.date = "2011-09-21"
|
|
13
|
+
s.description = "Geocode a text address."
|
|
14
|
+
s.email = "dempsey.travis@gmail.com"
|
|
15
|
+
s.executables = ["build_indexes", "rebuild_cluster", "rebuild_metaphones", "tiger_import"]
|
|
16
|
+
s.extra_rdoc_files = [
|
|
17
|
+
"README.rdoc"
|
|
18
|
+
]
|
|
19
|
+
s.files = [
|
|
20
|
+
"Gemfile",
|
|
21
|
+
"Gemfile.lock",
|
|
22
|
+
"History.txt",
|
|
23
|
+
"Makefile",
|
|
24
|
+
"Manifest.txt",
|
|
25
|
+
"README.rdoc",
|
|
26
|
+
"Rakefile",
|
|
27
|
+
"TODO.txt",
|
|
28
|
+
"VERSION",
|
|
29
|
+
"bin/build_indexes",
|
|
30
|
+
"bin/rebuild_cluster",
|
|
31
|
+
"bin/rebuild_metaphones",
|
|
32
|
+
"bin/tiger_import",
|
|
33
|
+
"demos/demo/app/ext/geocodewrap.rb",
|
|
34
|
+
"demos/demo/app/views/index.builder",
|
|
35
|
+
"demos/demo/app/views/index.erb",
|
|
36
|
+
"demos/demo/config.ru",
|
|
37
|
+
"demos/demo/config/bootstraps.rb",
|
|
38
|
+
"demos/demo/config/geoenvironment.rb",
|
|
39
|
+
"demos/demo/geocoder_helper.rb",
|
|
40
|
+
"demos/demo/geocom_geocode.rb",
|
|
41
|
+
"demos/demo/main.rb",
|
|
42
|
+
"demos/demo/rakefile.rb",
|
|
43
|
+
"demos/demo/tmp/restart.txt",
|
|
44
|
+
"demos/simpledemo/views/index.builder",
|
|
45
|
+
"demos/simpledemo/views/index.erb",
|
|
46
|
+
"demos/simpledemo/ws.rb",
|
|
47
|
+
"doc/Makefile",
|
|
48
|
+
"doc/html4css1.css",
|
|
49
|
+
"doc/lookup.rst",
|
|
50
|
+
"doc/parsing.rst",
|
|
51
|
+
"doc/voidspace.css",
|
|
52
|
+
"geo_coder.gemspec",
|
|
53
|
+
"lib/geocoder/us.rb",
|
|
54
|
+
"lib/geocoder/us/address.rb",
|
|
55
|
+
"lib/geocoder/us/constants.rb",
|
|
56
|
+
"lib/geocoder/us/database.rb",
|
|
57
|
+
"lib/geocoder/us/import.rb",
|
|
58
|
+
"lib/geocoder/us/import/tiger.rb",
|
|
59
|
+
"lib/geocoder/us/numbers.rb",
|
|
60
|
+
"navteq/README",
|
|
61
|
+
"navteq/convert.sql",
|
|
62
|
+
"navteq/navteq_import",
|
|
63
|
+
"navteq/prepare.sql",
|
|
64
|
+
"sql/cluster.sql",
|
|
65
|
+
"sql/convert.sql",
|
|
66
|
+
"sql/create.sql",
|
|
67
|
+
"sql/index.sql",
|
|
68
|
+
"sql/place.csv",
|
|
69
|
+
"sql/place.sql",
|
|
70
|
+
"sql/setup.sql",
|
|
71
|
+
"src/Makefile",
|
|
72
|
+
"src/README",
|
|
73
|
+
"src/liblwgeom/Makefile",
|
|
74
|
+
"src/liblwgeom/box2d.c",
|
|
75
|
+
"src/liblwgeom/lex.yy.c",
|
|
76
|
+
"src/liblwgeom/liblwgeom.h",
|
|
77
|
+
"src/liblwgeom/lwalgorithm.c",
|
|
78
|
+
"src/liblwgeom/lwalgorithm.h",
|
|
79
|
+
"src/liblwgeom/lwcircstring.c",
|
|
80
|
+
"src/liblwgeom/lwcollection.c",
|
|
81
|
+
"src/liblwgeom/lwcompound.c",
|
|
82
|
+
"src/liblwgeom/lwcurvepoly.c",
|
|
83
|
+
"src/liblwgeom/lwgeom.c",
|
|
84
|
+
"src/liblwgeom/lwgeom_api.c",
|
|
85
|
+
"src/liblwgeom/lwgparse.c",
|
|
86
|
+
"src/liblwgeom/lwgunparse.c",
|
|
87
|
+
"src/liblwgeom/lwline.c",
|
|
88
|
+
"src/liblwgeom/lwmcurve.c",
|
|
89
|
+
"src/liblwgeom/lwmline.c",
|
|
90
|
+
"src/liblwgeom/lwmpoint.c",
|
|
91
|
+
"src/liblwgeom/lwmpoly.c",
|
|
92
|
+
"src/liblwgeom/lwmsurface.c",
|
|
93
|
+
"src/liblwgeom/lwpoint.c",
|
|
94
|
+
"src/liblwgeom/lwpoly.c",
|
|
95
|
+
"src/liblwgeom/lwsegmentize.c",
|
|
96
|
+
"src/liblwgeom/lwutil.c",
|
|
97
|
+
"src/liblwgeom/measures.c",
|
|
98
|
+
"src/liblwgeom/postgis_config.h",
|
|
99
|
+
"src/liblwgeom/ptarray.c",
|
|
100
|
+
"src/liblwgeom/vsprintf.c",
|
|
101
|
+
"src/liblwgeom/wktparse.h",
|
|
102
|
+
"src/liblwgeom/wktparse.lex",
|
|
103
|
+
"src/liblwgeom/wktparse.tab.c",
|
|
104
|
+
"src/liblwgeom/wktparse.tab.h",
|
|
105
|
+
"src/liblwgeom/wktparse.y",
|
|
106
|
+
"src/libsqlite3_geocoder/Makefile",
|
|
107
|
+
"src/libsqlite3_geocoder/Makefile.nix",
|
|
108
|
+
"src/libsqlite3_geocoder/Makefile.redhat",
|
|
109
|
+
"src/libsqlite3_geocoder/extension.c",
|
|
110
|
+
"src/libsqlite3_geocoder/extension.h",
|
|
111
|
+
"src/libsqlite3_geocoder/levenshtein.c",
|
|
112
|
+
"src/libsqlite3_geocoder/metaphon.c",
|
|
113
|
+
"src/libsqlite3_geocoder/util.c",
|
|
114
|
+
"src/libsqlite3_geocoder/wkb_compress.c",
|
|
115
|
+
"src/metaphone/Makefile",
|
|
116
|
+
"src/metaphone/README",
|
|
117
|
+
"src/metaphone/extension.c",
|
|
118
|
+
"src/metaphone/metaphon.c",
|
|
119
|
+
"src/shp2sqlite/Makefile",
|
|
120
|
+
"src/shp2sqlite/Makefile.nix",
|
|
121
|
+
"src/shp2sqlite/Makefile.redhat",
|
|
122
|
+
"src/shp2sqlite/dbfopen.c",
|
|
123
|
+
"src/shp2sqlite/getopt.c",
|
|
124
|
+
"src/shp2sqlite/getopt.h",
|
|
125
|
+
"src/shp2sqlite/shapefil.h",
|
|
126
|
+
"src/shp2sqlite/shp2sqlite.c",
|
|
127
|
+
"src/shp2sqlite/shpopen.c",
|
|
128
|
+
"tests/address.rb",
|
|
129
|
+
"tests/benchmark.rb",
|
|
130
|
+
"tests/constants.rb",
|
|
131
|
+
"tests/data/address-sample.csv",
|
|
132
|
+
"tests/data/db-test.csv",
|
|
133
|
+
"tests/data/locations.csv",
|
|
134
|
+
"tests/database.rb",
|
|
135
|
+
"tests/generate.rb",
|
|
136
|
+
"tests/numbers.rb",
|
|
137
|
+
"tests/run.rb"
|
|
138
|
+
]
|
|
139
|
+
s.homepage = "http://github.com/kornypoet/geo_coder"
|
|
140
|
+
s.licenses = ["MIT"]
|
|
141
|
+
s.require_paths = ["lib"]
|
|
142
|
+
s.rubygems_version = "1.8.10"
|
|
143
|
+
s.summary = "Geocoder based upon the Geocommons Geocoder."
|
|
144
|
+
|
|
145
|
+
if s.respond_to? :specification_version then
|
|
146
|
+
s.specification_version = 3
|
|
147
|
+
|
|
148
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
149
|
+
s.add_runtime_dependency(%q<sqlite3-ruby>, ["= 1.2.5"])
|
|
150
|
+
s.add_runtime_dependency(%q<text>, [">= 0"])
|
|
151
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
|
152
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
|
|
153
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
|
154
|
+
s.add_development_dependency(%q<rspec>, [">= 0"])
|
|
155
|
+
else
|
|
156
|
+
s.add_dependency(%q<sqlite3-ruby>, ["= 1.2.5"])
|
|
157
|
+
s.add_dependency(%q<text>, [">= 0"])
|
|
158
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
|
159
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
|
160
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
|
161
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
|
162
|
+
end
|
|
163
|
+
else
|
|
164
|
+
s.add_dependency(%q<sqlite3-ruby>, ["= 1.2.5"])
|
|
165
|
+
s.add_dependency(%q<text>, [">= 0"])
|
|
166
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
|
167
|
+
s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
|
|
168
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
|
169
|
+
s.add_dependency(%q<rspec>, [">= 0"])
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
|
data/lib/geocoder/us.rb
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require "geocoder/us/database"
|
|
2
|
+
require "geocoder/us/address"
|
|
3
|
+
|
|
4
|
+
# Imports the Geocoder::US::Database and Geocoder::US::Address
|
|
5
|
+
# modules.
|
|
6
|
+
#
|
|
7
|
+
# General usage is as follows:
|
|
8
|
+
#
|
|
9
|
+
# >> require 'geocoder/us'
|
|
10
|
+
# >> db = Geocoder::US::Database.new("/opt/tiger/geocoder.db")
|
|
11
|
+
# >> p db.geocode("1600 Pennsylvania Av, Washington DC")
|
|
12
|
+
#
|
|
13
|
+
# [{:pretyp=>"", :street=>"Pennsylvania", :sufdir=>"NW", :zip=>"20502",
|
|
14
|
+
# :lon=>-77.037528, :number=>"1600", :fips_county=>"11001", :predir=>"",
|
|
15
|
+
# :precision=>:range, :city=>"Washington", :lat=>38.898746, :suftyp=>"Ave",
|
|
16
|
+
# :state=>"DC", :prequal=>"", :sufqual=>"", :score=>0.906, :prenum=>""}]
|
|
17
|
+
#
|
|
18
|
+
# See Geocoder::US::Database and README.txt for more details.
|
|
19
|
+
module Geocoder::US
|
|
20
|
+
VERSION = "2.0.0"
|
|
21
|
+
end
|