geocode_records 1.1.0 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +13 -0
- data/lib/geocode_records.rb +0 -1
- data/lib/geocode_records/update_table_from_csv.rb +8 -1
- data/lib/geocode_records/version.rb +1 -1
- metadata +3 -5
- data/bin/geocode_records +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e306eee237615f69d7580cc6a245bf23766c3396
|
4
|
+
data.tar.gz: 6824133fe7beaa511e33ee6ce7a0160fe1b08a4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 51d9e3d00efd93895dbbd94699cbdf95bce45db2f93e5ec0479e04b1b2e3c38a22ffac70b6dd731bddde77f4032f91a9e49da98e8326732262495a752064b708
|
7
|
+
data.tar.gz: 198b8e4790376b65e8cee69dfbe697333b5cb1455132196da090519ca586220ddd4d6a810aa9cd3572d4aa0d94dc4b00b405000e59c591f097f2f5ae6789c7ee
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
1.1.2 / 2018-01-23
|
2
|
+
|
3
|
+
* Enhancements
|
4
|
+
|
5
|
+
* More robust house number handling
|
6
|
+
|
7
|
+
1.1.1 / 2018-01-22
|
8
|
+
|
9
|
+
* Enhancements
|
10
|
+
|
11
|
+
* Remove non-working binary
|
12
|
+
* Remove debug warning when it doesn't find records for a glob
|
13
|
+
|
1
14
|
1.1.0 / 2018-01-16
|
2
15
|
|
3
16
|
* Breaking changes
|
data/lib/geocode_records.rb
CHANGED
@@ -34,7 +34,14 @@ class GeocodeRecords
|
|
34
34
|
UPDATE $TABLE_NAME AS target
|
35
35
|
SET
|
36
36
|
house_number_and_street = src.ss_delivery_line_1,
|
37
|
-
house_number = CASE
|
37
|
+
house_number = CASE
|
38
|
+
WHEN src.ss_primary_number IS NULL THEN NULL
|
39
|
+
WHEN LENGTH(src.ss_primary_number) > 8 THEN NULL
|
40
|
+
WHEN src.ss_primary_number ~ '\\A\\d+\\Z' THEN src.ss_primary_number::int
|
41
|
+
WHEN src.ss_primary_number ~ '/' THEN (regexp_matches(src.ss_primary_number, '(\\d+)'))[1]::int
|
42
|
+
WHEN src.ss_primary_number ~ '-' THEN (SELECT ROUND(AVG(v)) FROM unnest(array_remove(regexp_split_to_array(src.ss_primary_number, '\\D+'), '')::int[]) v)
|
43
|
+
ELSE (regexp_matches(src.ss_primary_number, '(\\d+)'))[1]::int
|
44
|
+
END,
|
38
45
|
unit_number = src.ss_secondary_number,
|
39
46
|
city = COALESCE(src.ss_default_city_name, src.ss_city_name),
|
40
47
|
state = src.ss_state_abbreviation,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: geocode_records
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seamus Abshere
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -111,8 +111,7 @@ dependencies:
|
|
111
111
|
description: A quick way to re-geocode a table. Requires 2 binaries, so YMMV.
|
112
112
|
email:
|
113
113
|
- seamus@abshere.net
|
114
|
-
executables:
|
115
|
-
- geocode_records
|
114
|
+
executables: []
|
116
115
|
extensions: []
|
117
116
|
extra_rdoc_files: []
|
118
117
|
files:
|
@@ -124,7 +123,6 @@ files:
|
|
124
123
|
- LICENSE.txt
|
125
124
|
- README.md
|
126
125
|
- Rakefile
|
127
|
-
- bin/geocode_records
|
128
126
|
- geocode_records.gemspec
|
129
127
|
- lib/geocode_records.rb
|
130
128
|
- lib/geocode_records/dump_sql_to_csv.rb
|
data/bin/geocode_records
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'logger'
|
4
|
-
|
5
|
-
require 'geocode_records'
|
6
|
-
|
7
|
-
ActiveRecord::Base.establish_connection ENV.fetch('DATABASE_URL')
|
8
|
-
|
9
|
-
logger = Logger.new($stderr)
|
10
|
-
logger.level = Logger::WARN
|
11
|
-
ActiveRecord::Base.logger = logger
|
12
|
-
Upsert.logger = logger
|
13
|
-
|
14
|
-
class Whatever < ActiveRecord::Base
|
15
|
-
self.table_name = ARGV[0]
|
16
|
-
end
|
17
|
-
|
18
|
-
GeocodeRecords.new(Whatever.all).perform
|