Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: geocommons/geocoder
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: simplegeo/geocoder
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.

Commits on Jun 21, 2011

  1. Fix "San Francisco, CA" by not geocoding place names to unique-type Z…

    …IPs.
    Schuyler Erle committed Jun 21, 2011
    Copy the full SHA
    8bc9ec0 View commit details
  2. Merge commit '8bc9ec02913a4f3b770f76a05b0b179e951db03c'

    Simple Geebus committed Jun 21, 2011
    Copy the full SHA
    966cd4b View commit details
  3. Prepared changelog for build 67

    Simple Geebus committed Jun 21, 2011
    Copy the full SHA
    4801cb5 View commit details

Commits on Jun 27, 2011

  1. Prepared changelog for build 95

    Simple Geebus committed Jun 27, 2011
    Copy the full SHA
    088758c View commit details

Commits on Jun 28, 2011

  1. Prepared changelog for build 98

    Simple Geebus committed Jun 28, 2011
    Copy the full SHA
    a26f959 View commit details

Commits on Jun 29, 2011

  1. Prepared changelog for build 99

    Simple Geebus committed Jun 29, 2011
    Copy the full SHA
    33e17ca View commit details

Commits on Jun 30, 2011

  1. Prepared changelog for build 100

    Simple Geebus committed Jun 30, 2011
    Copy the full SHA
    727ca24 View commit details
  2. Prepared changelog for build 101

    Simple Geebus committed Jun 30, 2011
    Copy the full SHA
    158a86e View commit details
  3. Prepared changelog for build 102

    Simple Geebus committed Jun 30, 2011
    Copy the full SHA
    14b4e7e View commit details

Commits on Jul 1, 2011

  1. Prepared changelog for build 103

    Simple Geebus committed Jul 1, 2011
    Copy the full SHA
    19ac453 View commit details

Commits on Jul 5, 2011

  1. Prepared changelog for build 104

    Simple Geebus committed Jul 5, 2011
    Copy the full SHA
    bdc76b8 View commit details

Commits on Jul 17, 2011

  1. Prepared changelog for build 105

    Simple Geebus committed Jul 17, 2011
    Copy the full SHA
    5acad22 View commit details

Commits on Jul 26, 2011

  1. Prepared changelog for build 106

    Simple Geebus committed Jul 26, 2011
    Copy the full SHA
    67fb58f View commit details

Commits on Aug 3, 2011

  1. Prepared changelog for build 107

    Simple Geebus committed Aug 3, 2011
    Copy the full SHA
    48b7765 View commit details

Commits on Aug 6, 2011

  1. Prepared changelog for build 109

    Simple Geebus committed Aug 6, 2011
    Copy the full SHA
    cfe7ec5 View commit details

Commits on Aug 9, 2011

  1. Prepared changelog for build 110

    Simple Geebus committed Aug 9, 2011
    Copy the full SHA
    f63aea6 View commit details
  2. Merge commit '4d2bdb7cdbfb23479e2c3acadffeab81f71de530'

    Simple Geebus committed Aug 9, 2011
    Copy the full SHA
    1c81eec View commit details
  3. Prepared changelog for build 111

    Simple Geebus committed Aug 9, 2011
    Copy the full SHA
    5bf3d4a View commit details
  4. Update version

    dsmith committed Aug 9, 2011
    Copy the full SHA
    4d2bdb7 View commit details

Commits on Sep 6, 2011

  1. Remove country from address strings.

    Schuyler Erle committed Sep 6, 2011
    Copy the full SHA
    322a3ef View commit details
  2. Merge commit '322a3efd72ab34d23047671ef593ea5c4057f119'

    Simple Geebus committed Sep 6, 2011
    Copy the full SHA
    deb07fc View commit details
  3. Prepared changelog for build 112

    Simple Geebus committed Sep 6, 2011
    Copy the full SHA
    4bbe577 View commit details
  4. Prepared changelog for build 113

    Simple Geebus committed Sep 6, 2011
    Copy the full SHA
    c85708a View commit details

Commits on Sep 7, 2011

  1. Prepared changelog for build 114

    Simple Geebus committed Sep 7, 2011
    Copy the full SHA
    2119a34 View commit details
  2. Prepared changelog for build 115

    Simple Geebus committed Sep 7, 2011
    Copy the full SHA
    79964d1 View commit details
  3. Prepared changelog for build 116

    Simple Geebus committed Sep 7, 2011
    Copy the full SHA
    6fb0bc9 View commit details
  4. Prepared changelog for build 117

    Simple Geebus committed Sep 7, 2011
    Copy the full SHA
    43ba1c6 View commit details
  5. Prepared changelog for build 121

    Simple Geebus committed Sep 7, 2011
    Copy the full SHA
    f21b146 View commit details
  6. Prepared changelog for build 122

    Simple Geebus committed Sep 7, 2011
    Copy the full SHA
    b370200 View commit details

Commits on Sep 9, 2011

  1. This is a hack, pending a better fix.

    Schuyler Erle committed Sep 9, 2011
    Copy the full SHA
    fba0dcb View commit details
  2. Merge commit 'fba0dcbb725fc2ae382b6488bd1f2a5dab0e47bc'

    Simple Geebus committed Sep 9, 2011
    Copy the full SHA
    6f587f0 View commit details
  3. Prepared changelog for build 123

    Simple Geebus committed Sep 9, 2011
    Copy the full SHA
    e1145b4 View commit details

Commits on Dec 9, 2011

  1. Prepared changelog for build 124

    Simple Geebus committed Dec 9, 2011
    Copy the full SHA
    c610680 View commit details

Commits on Dec 13, 2011

  1. Fix upstart job

    dsmith committed Dec 13, 2011
    Copy the full SHA
    a266dd8 View commit details
  2. Merge commit 'a266dd867385c57be52a6b1c7bd1533034ce3476'

    Jenkins slave user committed Dec 13, 2011
    Copy the full SHA
    8de2e62 View commit details
  3. Prepared changelog for build 126

    Jenkins slave user committed Dec 13, 2011
    Copy the full SHA
    93ca445 View commit details

Commits on Dec 16, 2011

  1. Prepared changelog for build 127

    Jenkins slave user committed Dec 16, 2011
    Copy the full SHA
    af95bc0 View commit details
  2. Prepared changelog for build 128

    Jenkins slave user committed Dec 16, 2011
    Copy the full SHA
    5c7f678 View commit details
Showing with 200 additions and 3 deletions.
  1. +0 −1 conf/init/geocoder-us.conf
  2. +184 −0 debian/changelog
  3. +1 −1 debian/control
  4. +4 −0 lib/geocoder/us/address.rb
  5. +11 −1 lib/geocoder/us/database.rb
1 change: 0 additions & 1 deletion conf/init/geocoder-us.conf
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@ start on runlevel [2345]
stop on runlevel [!2345]

respawn
expect daemon
script
. /etc/default/geocoder-us
unicorn -c /etc/geocoder-us/unicorn.rb /etc/geocoder-us/geocoder.ru
184 changes: 184 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,187 @@
geocoder-us (2.0.1pre-1sg128) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Fri, 16 Dec 2011 01:04:40 +0000

geocoder-us (2.0.1pre-1sg127) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Fri, 16 Dec 2011 00:56:42 +0000

geocoder-us (2.0.1pre-1sg126) maverick; urgency=low

[ Derek Smith ]
* Fix upstart job

[ SimpleGeo Nerds ]

-- SimpleGeo Nerds <nerds@simplegeo.com> Tue, 13 Dec 2011 22:31:12 +0000

geocoder-us (2.0.1pre-1sg124) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Fri, 09 Dec 2011 01:24:46 +0000

geocoder-us (2.0.1pre-1sg123) maverick; urgency=low

[ Schuyler Erle ]
* This is a hack, pending a better fix.

[ SimpleGeo Nerds ]

-- SimpleGeo Nerds <nerds@simplegeo.com> Fri, 09 Sep 2011 22:05:43 +0000

geocoder-us (2.0.1pre-1sg122) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Wed, 07 Sep 2011 20:35:46 +0000

geocoder-us (2.0.1pre-1sg121) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Wed, 07 Sep 2011 20:31:17 +0000

geocoder-us (2.0.1pre-1sg117) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Wed, 07 Sep 2011 19:37:37 +0000

geocoder-us (2.0.1pre-1sg116) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Wed, 07 Sep 2011 18:15:01 +0000

geocoder-us (2.0.1pre-1sg115) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Wed, 07 Sep 2011 18:10:40 +0000

geocoder-us (2.0.1pre-1sg114) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Wed, 07 Sep 2011 00:14:40 +0000

geocoder-us (2.0.1pre-1sg113) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Tue, 06 Sep 2011 23:43:21 +0000

geocoder-us (2.0.1pre-1sg112) maverick; urgency=low

[ Schuyler Erle ]
* Remove country from address strings.

[ SimpleGeo Nerds ]

-- SimpleGeo Nerds <nerds@simplegeo.com> Tue, 06 Sep 2011 23:06:04 +0000

geocoder-us (2.0.1pre-1sg111) maverick; urgency=low

[ dsmith ]
* Update version

[ SimpleGeo Nerds ]

-- SimpleGeo Nerds <nerds@simplegeo.com> Tue, 09 Aug 2011 18:16:41 +0000

geocoder-us (2.0.1pre-1sg110) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Tue, 09 Aug 2011 17:45:35 +0000

geocoder-us (2.0.1pre-1sg109) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Sat, 06 Aug 2011 01:02:17 +0000

geocoder-us (2.0.1pre-1sg107) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Wed, 03 Aug 2011 19:11:49 +0000

geocoder-us (2.0.1pre-1sg106) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Tue, 26 Jul 2011 00:08:57 +0000

geocoder-us (2.0.1pre-1sg105) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Sun, 17 Jul 2011 14:11:06 +0000

geocoder-us (2.0.1pre-1sg104) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Tue, 05 Jul 2011 21:08:16 +0000

geocoder-us (2.0.1pre-1sg103) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Fri, 01 Jul 2011 23:54:02 +0000

geocoder-us (2.0.1pre-1sg102) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Thu, 30 Jun 2011 23:48:57 +0000

geocoder-us (2.0.1pre-1sg101) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Thu, 30 Jun 2011 19:34:05 +0000

geocoder-us (2.0.1pre-1sg100) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Thu, 30 Jun 2011 08:10:28 +0000

geocoder-us (2.0.1pre-1sg99) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Wed, 29 Jun 2011 22:46:24 +0000

geocoder-us (2.0.1pre-1sg98) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Tue, 28 Jun 2011 06:13:30 +0000

geocoder-us (2.0.1pre-1sg95) maverick; urgency=low

* UNRELEASED

-- SimpleGeo Nerds <nerds@simplegeo.com> Mon, 27 Jun 2011 22:04:07 +0000

geocoder-us (2.0.1pre-1sg67) lucid; urgency=low

[ Schuyler Erle ]
* Fix "San Francisco, CA" by not geocoding place names to unique-type
ZIPs.

[ SimpleGeo Nerds ]

-- SimpleGeo Nerds <nerds@simplegeo.com> Tue, 21 Jun 2011 21:49:48 +0000

geocoder-us (2.0.1pre-1sg66) lucid; urgency=low

[ Schuyler Erle ]
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ Priority: extra
Maintainer: SimpleGeo Nerds <nerds@simplegeo.com>
Uploaders: Schuyler Erle <schuyler@simplegeo.com>
Build-Depends: debhelper (>= 7), libsqlite3-dev, ruby1.8, cdbs, ruby-pkg-tools
Standards-Version: 3.8.4
Standards-Version: 3.9.1
Homepage: http://github.com/simplegeo/geocoder/

Package: geocoder-us
4 changes: 4 additions & 0 deletions lib/geocoder/us/address.rb
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ module Geocoder::US
:street => /(?:\b(?:\d+\w*|[a-z'-]+)\s*)+/io,
:city => /(?:\b[a-z'-]+\s*)+/io,
:state => Regexp.new(State.regexp.source + "\s*$", Regexp::IGNORECASE),
:country => /\b(?:united states(?: of america)?|usa?)\b$/io,
:zip => /(\d{5})(?:-\d{4})?\s*$/o,
:at => /\s(at|@|and|&)\s/io,
:po_box => /\b[P|p]*(OST|ost)*\.*\s*[O|o|0]*(ffice|FFICE)*\.*\s*[B|b][O|o|0][X|x]\b/
@@ -39,6 +40,7 @@ def initialize (text)
# Removes any characters that aren't strictly part of an address string.
def clean (value)
value.strip \
.gsub(/[()\[\]{}"]+/io, " ") \
.gsub(/[^a-z0-9 ,'&@\/-]+/io, "") \
.gsub(/\s+/o, " ")
end
@@ -152,6 +154,8 @@ def parse_number(regex_match, text)
def parse
text = @text.clone.downcase

text.sub! Match[:country], ""

@zip = text.scan(Match[:zip])[-1]
if @zip
text = parse_zip($&, text)
12 changes: 11 additions & 1 deletion lib/geocoder/us/database.rb
Original file line number Diff line number Diff line change
@@ -178,8 +178,16 @@ def places_by_city (city, tokens, state)
args = [city] + tokens.clone + [state]
end
metaphones = metaphone_placeholders_for tokens
# Addendum: Don't include unique or business ZIP codes when searching for
# addresses by place name, because weird things happen, like the point winding
# up out in the Pacific Ocean (thanks to the Farallons). Unlike unique ZIP codes,
# general ZIP codes have all been checked to ensure that they're actually within
# their ZCTA.
#
execute("SELECT *, levenshtein(?, city) AS city_score
FROM place WHERE city_phone IN (#{metaphones}) #{and_state} order by priority desc;", *args)
FROM place WHERE city_phone IN (#{metaphones}) #{and_state}
AND status NOT IN ('U','B')
ORDER BY PRIORITY DESC;", *args)
end

# Generate an SQL query and set of parameters against the feature and range
@@ -278,6 +286,8 @@ def intersections_by_fid (fids)
temp_db = "temp_" + rand(1<<32).to_s
temp_table = "intersection_" + rand(1<<32).to_s
execute "ATTACH DATABASE ':memory:' as #{temp_db};"
# avoid hitting a (configurable?) SQL variable limit in SQLite3 (defaults to 999)
fids = fids[0..247] if fids.length >= 495;
begin
# flush_statements # the CREATE/DROP TABLE invalidates prepared statements
in_list = placeholders_for fids