From 311b6542e6d1fe97101a7a83128e82f92ef927d1 Mon Sep 17 00:00:00 2001 From: David Wilkie Date: Sat, 12 Oct 2024 13:56:36 +0700 Subject: [PATCH] Correctly sort cities by name and county (#30) --- data/cities/us/ar.json | 36 ++-- data/cities/us/ca.json | 124 ++++++------ data/cities/us/ct.json | 36 ++-- data/cities/us/ga.json | 36 ++-- data/cities/us/il.json | 36 ++-- data/cities/us/in.json | 36 ++-- data/cities/us/nj.json | 36 ++-- data/cities/us/ny.json | 36 ++-- data/cities/us/oh.json | 144 ++++++------- data/cities/us/ok.json | 36 ++-- data/cities/us/or.json | 36 ++-- data/cities/us/pa.json | 224 ++++++++++----------- data/cities/us/pr.json | 108 +++++----- data/cities/us/sc.json | 44 ++-- data/cities/us/sd.json | 36 ++-- data/cities/us/tn.json | 36 ++-- data/cities/us/tx.json | 124 ++++++------ data/cities/us/va.json | 36 ++-- lib/rate_center/data_prep.rb | 2 +- lib/rate_center/data_source/simple_maps.rb | 2 +- 20 files changed, 602 insertions(+), 602 deletions(-) diff --git a/data/cities/us/ar.json b/data/cities/us/ar.json index 8f90089..78bf05c 100644 --- a/data/cities/us/ar.json +++ b/data/cities/us/ar.json @@ -9261,44 +9261,44 @@ { "country": "US", "region": "AR", - "county": "Pope", + "county": "Carroll", "name": "Oak Grove", - "lat": "35.3594", - "long": "-92.9598", + "lat": "36.4642", + "long": "-93.4302", "nearby_rate_centers": [ { - "name": "HECTOR", - "distance_km": 11.17 + "name": "OAK GROVE", + "distance_km": 1.12 }, { - "name": "ATKINS", - "distance_km": 13.53 + "name": "GREEN FOR", + "distance_km": 14.54 }, { - "name": "DOVER", - "distance_km": 14.95 + "name": "BERRYVILLE", + "distance_km": 16.25 } ] }, { "country": "US", "region": "AR", - "county": "Carroll", + "county": "Pope", "name": "Oak Grove", - "lat": "36.4642", - "long": "-93.4302", + "lat": "35.3594", + "long": "-92.9598", "nearby_rate_centers": [ { - "name": "OAK GROVE", - "distance_km": 1.12 + "name": "HECTOR", + "distance_km": 11.17 }, { - "name": "GREEN FOR", - "distance_km": 14.54 + "name": "ATKINS", + "distance_km": 13.53 }, { - "name": "BERRYVILLE", - "distance_km": 16.25 + "name": "DOVER", + "distance_km": 14.95 } ] }, diff --git a/data/cities/us/ca.json b/data/cities/us/ca.json index 596afaa..6765f6b 100644 --- a/data/cities/us/ca.json +++ b/data/cities/us/ca.json @@ -5627,44 +5627,44 @@ { "country": "US", "region": "CA", - "county": "Shasta", + "county": "Fresno", "name": "Centerville", - "lat": "40.5430", - "long": "-122.4638", + "lat": "36.7361", + "long": "-119.4961", "nearby_rate_centers": [ { - "name": "REDDING", - "distance_km": 7.67 + "name": "TIVYVALLEY", + "distance_km": 4.58 }, { - "name": "OLINDA", - "distance_km": 12.52 + "name": "SANGER", + "distance_km": 5.88 }, { - "name": "ANDERSON", - "distance_km": 17.33 + "name": "DEL REY", + "distance_km": 12.09 } ] }, { "country": "US", "region": "CA", - "county": "Fresno", + "county": "Shasta", "name": "Centerville", - "lat": "36.7361", - "long": "-119.4961", + "lat": "40.5430", + "long": "-122.4638", "nearby_rate_centers": [ { - "name": "TIVYVALLEY", - "distance_km": 4.58 + "name": "REDDING", + "distance_km": 7.67 }, { - "name": "SANGER", - "distance_km": 5.88 + "name": "OLINDA", + "distance_km": 12.52 }, { - "name": "DEL REY", - "distance_km": 12.09 + "name": "ANDERSON", + "distance_km": 17.33 } ] }, @@ -7240,28 +7240,6 @@ } ] }, - { - "country": "US", - "region": "CA", - "county": "Shasta", - "name": "Cottonwood", - "lat": "40.3903", - "long": "-122.3156", - "nearby_rate_centers": [ - { - "name": "COTTONWOOD", - "distance_km": 2.96 - }, - { - "name": "ANDERSON", - "distance_km": 7.08 - }, - { - "name": "OLINDA", - "distance_km": 10.55 - } - ] - }, { "country": "US", "region": "CA", @@ -7292,6 +7270,28 @@ } ] }, + { + "country": "US", + "region": "CA", + "county": "Shasta", + "name": "Cottonwood", + "lat": "40.3903", + "long": "-122.3156", + "nearby_rate_centers": [ + { + "name": "COTTONWOOD", + "distance_km": 2.96 + }, + { + "name": "ANDERSON", + "distance_km": 7.08 + }, + { + "name": "OLINDA", + "distance_km": 10.55 + } + ] + }, { "country": "US", "region": "CA", @@ -10878,28 +10878,6 @@ } ] }, - { - "country": "US", - "region": "CA", - "county": "Marin", - "name": "Fairfax", - "lat": "37.9886", - "long": "-122.5952", - "nearby_rate_centers": [ - { - "name": "SAN RAFAEL", - "distance_km": 6.12 - }, - { - "name": "CORTEMADRA", - "distance_km": 7.68 - }, - { - "name": "IGNACIO", - "distance_km": 9.63 - } - ] - }, { "country": "US", "region": "CA", @@ -10930,6 +10908,28 @@ } ] }, + { + "country": "US", + "region": "CA", + "county": "Marin", + "name": "Fairfax", + "lat": "37.9886", + "long": "-122.5952", + "nearby_rate_centers": [ + { + "name": "SAN RAFAEL", + "distance_km": 6.12 + }, + { + "name": "CORTEMADRA", + "distance_km": 7.68 + }, + { + "name": "IGNACIO", + "distance_km": 9.63 + } + ] + }, { "country": "US", "region": "CA", diff --git a/data/cities/us/ct.json b/data/cities/us/ct.json index 28990b6..a83b014 100644 --- a/data/cities/us/ct.json +++ b/data/cities/us/ct.json @@ -1709,44 +1709,44 @@ { "country": "US", "region": "CT", - "county": "Southeastern Connecticut", + "county": "Greater Bridgeport", "name": "Long Hill", - "lat": "41.3536", - "long": "-72.0517", + "lat": "41.2666", + "long": "-73.2283", "nearby_rate_centers": [ { - "name": "NEW LONDON", - "distance_km": 3.91 + "name": "TRUMBULL", + "distance_km": 0.64 }, { - "name": "MYSTIC", - "distance_km": 7.0 + "name": "HUNTINGTON", + "distance_km": 7.29 }, { - "name": "LEDYARD", - "distance_km": 8.7 + "name": "BRIDGEPORT", + "distance_km": 10.25 } ] }, { "country": "US", "region": "CT", - "county": "Greater Bridgeport", + "county": "Southeastern Connecticut", "name": "Long Hill", - "lat": "41.2666", - "long": "-73.2283", + "lat": "41.3536", + "long": "-72.0517", "nearby_rate_centers": [ { - "name": "TRUMBULL", - "distance_km": 0.64 + "name": "NEW LONDON", + "distance_km": 3.91 }, { - "name": "HUNTINGTON", - "distance_km": 7.29 + "name": "MYSTIC", + "distance_km": 7.0 }, { - "name": "BRIDGEPORT", - "distance_km": 10.25 + "name": "LEDYARD", + "distance_km": 8.7 } ] }, diff --git a/data/cities/us/ga.json b/data/cities/us/ga.json index 7b5033e..a1289e2 100644 --- a/data/cities/us/ga.json +++ b/data/cities/us/ga.json @@ -1851,44 +1851,44 @@ { "country": "US", "region": "GA", - "county": "Morgan", + "county": "Bryan", "name": "Buckhead", - "lat": "33.5686", - "long": "-83.3623", + "lat": "31.8613", + "long": "-81.2623", "nearby_rate_centers": [ { - "name": "MADISON", - "distance_km": 10.18 + "name": "KELLER", + "distance_km": 2.1 }, { - "name": "GREENSBORO", - "distance_km": 16.68 + "name": "RICHMONDHL", + "distance_km": 4.57 }, { - "name": "RUTLEDGE", - "distance_km": 24.15 + "name": "MIDWAY", + "distance_km": 16.26 } ] }, { "country": "US", "region": "GA", - "county": "Bryan", + "county": "Morgan", "name": "Buckhead", - "lat": "31.8613", - "long": "-81.2623", + "lat": "33.5686", + "long": "-83.3623", "nearby_rate_centers": [ { - "name": "KELLER", - "distance_km": 2.1 + "name": "MADISON", + "distance_km": 10.18 }, { - "name": "RICHMONDHL", - "distance_km": 4.57 + "name": "GREENSBORO", + "distance_km": 16.68 }, { - "name": "MIDWAY", - "distance_km": 16.26 + "name": "RUTLEDGE", + "distance_km": 24.15 } ] }, diff --git a/data/cities/us/il.json b/data/cities/us/il.json index 7b04379..26a211d 100644 --- a/data/cities/us/il.json +++ b/data/cities/us/il.json @@ -16263,44 +16263,44 @@ { "country": "US", "region": "IL", - "county": "Shelby", + "county": "McHenry", "name": "Lakewood", - "lat": "39.3235", - "long": "-88.8981", + "lat": "42.2279", + "long": "-88.3931", "nearby_rate_centers": [ { - "name": "COWDEN", - "distance_km": 9.08 + "name": "CRYSTAL LK", + "distance_km": 6.15 }, { - "name": "TOWER HILL", - "distance_km": 9.19 + "name": "HUNTLEY", + "distance_km": 7.06 }, { - "name": "SHELBYVL", - "distance_km": 12.66 + "name": "ALGONQUIN", + "distance_km": 10.76 } ] }, { "country": "US", "region": "IL", - "county": "McHenry", + "county": "Shelby", "name": "Lakewood", - "lat": "42.2279", - "long": "-88.3931", + "lat": "39.3235", + "long": "-88.8981", "nearby_rate_centers": [ { - "name": "CRYSTAL LK", - "distance_km": 6.15 + "name": "COWDEN", + "distance_km": 9.08 }, { - "name": "HUNTLEY", - "distance_km": 7.06 + "name": "TOWER HILL", + "distance_km": 9.19 }, { - "name": "ALGONQUIN", - "distance_km": 10.76 + "name": "SHELBYVL", + "distance_km": 12.66 } ] }, diff --git a/data/cities/us/in.json b/data/cities/us/in.json index ed2ae10..65f3c5c 100644 --- a/data/cities/us/in.json +++ b/data/cities/us/in.json @@ -6701,44 +6701,44 @@ { "country": "US", "region": "IN", - "county": "Shelby", + "county": "Adams", "name": "Geneva", - "lat": "39.3912", - "long": "-85.7175", + "lat": "40.5975", + "long": "-84.9568", "nearby_rate_centers": [ { - "name": "WALDRON", - "distance_km": 8.28 + "name": "GENEVA", + "distance_km": 0.58 }, { - "name": "HOPE", - "distance_km": 10.68 + "name": "BERNE", + "distance_km": 6.54 }, { - "name": "FLAT ROCK", - "distance_km": 11.45 + "name": "BRYANT", + "distance_km": 7.55 } ] }, { "country": "US", "region": "IN", - "county": "Adams", + "county": "Shelby", "name": "Geneva", - "lat": "40.5975", - "long": "-84.9568", + "lat": "39.3912", + "long": "-85.7175", "nearby_rate_centers": [ { - "name": "GENEVA", - "distance_km": 0.58 + "name": "WALDRON", + "distance_km": 8.28 }, { - "name": "BERNE", - "distance_km": 6.54 + "name": "HOPE", + "distance_km": 10.68 }, { - "name": "BRYANT", - "distance_km": 7.55 + "name": "FLAT ROCK", + "distance_km": 11.45 } ] }, diff --git a/data/cities/us/nj.json b/data/cities/us/nj.json index f9fd417..8510a15 100644 --- a/data/cities/us/nj.json +++ b/data/cities/us/nj.json @@ -11763,44 +11763,44 @@ { "country": "US", "region": "NJ", - "county": "Essex", + "county": "Cumberland", "name": "Silver Lake", - "lat": "40.7804", - "long": "-74.1829", + "lat": "39.4675", + "long": "-75.2408", "nearby_rate_centers": [ { - "name": "BLOOMFIELD", - "distance_km": 2.68 + "name": "BRIDGETON", + "distance_km": 4.48 }, { - "name": "BELLEVILLE", - "distance_km": 2.84 + "name": "CEDARVILLE", + "distance_km": 15.27 }, { - "name": "KEARNY", - "distance_km": 3.09 + "name": "ELMER", + "distance_km": 15.33 } ] }, { "country": "US", "region": "NJ", - "county": "Cumberland", + "county": "Essex", "name": "Silver Lake", - "lat": "39.4675", - "long": "-75.2408", + "lat": "40.7804", + "long": "-74.1829", "nearby_rate_centers": [ { - "name": "BRIDGETON", - "distance_km": 4.48 + "name": "BLOOMFIELD", + "distance_km": 2.68 }, { - "name": "CEDARVILLE", - "distance_km": 15.27 + "name": "BELLEVILLE", + "distance_km": 2.84 }, { - "name": "ELMER", - "distance_km": 15.33 + "name": "KEARNY", + "distance_km": 3.09 } ] }, diff --git a/data/cities/us/ny.json b/data/cities/us/ny.json index 9caf646..25c7a9d 100644 --- a/data/cities/us/ny.json +++ b/data/cities/us/ny.json @@ -21457,44 +21457,44 @@ { "country": "US", "region": "NY", - "county": "Orange", + "county": "Nassau", "name": "Woodbury", - "lat": "41.3284", - "long": "-74.1004", + "lat": "40.8176", + "long": "-73.4703", "nearby_rate_centers": [ { - "name": "HIGHLANDML", - "distance_km": 2.01 + "name": "COLDSPGHBR", + "distance_km": 5.88 }, { - "name": "MONROE", - "distance_km": 7.34 + "name": "NASSAUZN08", + "distance_km": 6.54 }, { - "name": "HIGHLD FLS", - "distance_km": 12.21 + "name": "NASSAUZN07", + "distance_km": 6.74 } ] }, { "country": "US", "region": "NY", - "county": "Nassau", + "county": "Orange", "name": "Woodbury", - "lat": "40.8176", - "long": "-73.4703", + "lat": "41.3284", + "long": "-74.1004", "nearby_rate_centers": [ { - "name": "COLDSPGHBR", - "distance_km": 5.88 + "name": "HIGHLANDML", + "distance_km": 2.01 }, { - "name": "NASSAUZN08", - "distance_km": 6.54 + "name": "MONROE", + "distance_km": 7.34 }, { - "name": "NASSAUZN07", - "distance_km": 6.74 + "name": "HIGHLD FLS", + "distance_km": 12.21 } ] }, diff --git a/data/cities/us/oh.json b/data/cities/us/oh.json index 137f081..aab13c2 100644 --- a/data/cities/us/oh.json +++ b/data/cities/us/oh.json @@ -9887,44 +9887,44 @@ { "country": "US", "region": "OH", - "county": "Stark", + "county": "Franklin", "name": "Harrisburg", - "lat": "40.8873", - "long": "-81.2300", + "lat": "39.8108", + "long": "-83.1687", "nearby_rate_centers": [ { - "name": "LOUISVILLE", - "distance_km": 6.02 + "name": "HARRISBURG", + "distance_km": 0.39 }, { - "name": "MARLBORO", - "distance_km": 7.11 + "name": "GROVE CITY", + "distance_km": 9.55 }, { - "name": "PARIS", - "distance_km": 11.1 + "name": "MTSTERLING", + "distance_km": 13.24 } ] }, { "country": "US", "region": "OH", - "county": "Franklin", + "county": "Stark", "name": "Harrisburg", - "lat": "39.8108", - "long": "-83.1687", + "lat": "40.8873", + "long": "-81.2300", "nearby_rate_centers": [ { - "name": "HARRISBURG", - "distance_km": 0.39 + "name": "LOUISVILLE", + "distance_km": 6.02 }, { - "name": "GROVE CITY", - "distance_km": 9.55 + "name": "MARLBORO", + "distance_km": 7.11 }, { - "name": "MTSTERLING", - "distance_km": 13.24 + "name": "PARIS", + "distance_km": 11.1 } ] }, @@ -12895,44 +12895,44 @@ { "country": "US", "region": "OH", - "county": "Richland", + "county": "Hamilton", "name": "Lincoln Heights", - "lat": "40.7673", - "long": "-82.4795", + "lat": "39.2434", + "long": "-84.4570", "nearby_rate_centers": [ { - "name": "MANSFIELD", - "distance_km": 3.2 + "name": "CINCINNATI", + "distance_km": 16.69 }, { - "name": "LUCAS", - "distance_km": 9.27 + "name": "BETHANY", + "distance_km": 17.06 }, { - "name": "LEXINGTON", - "distance_km": 12.91 + "name": "LTL MIAMI", + "distance_km": 17.12 } ] }, { "country": "US", "region": "OH", - "county": "Hamilton", + "county": "Richland", "name": "Lincoln Heights", - "lat": "39.2434", - "long": "-84.4570", + "lat": "40.7673", + "long": "-82.4795", "nearby_rate_centers": [ { - "name": "CINCINNATI", - "distance_km": 16.69 + "name": "MANSFIELD", + "distance_km": 3.2 }, { - "name": "BETHANY", - "distance_km": 17.06 + "name": "LUCAS", + "distance_km": 9.27 }, { - "name": "LTL MIAMI", - "distance_km": 17.12 + "name": "LEXINGTON", + "distance_km": 12.91 } ] }, @@ -18423,22 +18423,22 @@ { "country": "US", "region": "OH", - "county": "Paulding", + "county": "Cuyahoga", "name": "Oakwood", - "lat": "41.0927", - "long": "-84.3747", + "lat": "41.3669", + "long": "-81.5036", "nearby_rate_centers": [ { - "name": "OAKWOOD", - "distance_km": 0.74 + "name": "BEDFORD", + "distance_km": 3.71 }, { - "name": "CONTINNTAL", - "distance_km": 9.18 + "name": "NORTHFIELD", + "distance_km": 6.58 }, { - "name": "CLOVERDALE", - "distance_km": 10.5 + "name": "MONTRSE", + "distance_km": 7.9 } ] }, @@ -18467,22 +18467,22 @@ { "country": "US", "region": "OH", - "county": "Cuyahoga", + "county": "Paulding", "name": "Oakwood", - "lat": "41.3669", - "long": "-81.5036", + "lat": "41.0927", + "long": "-84.3747", "nearby_rate_centers": [ { - "name": "BEDFORD", - "distance_km": 3.71 + "name": "OAKWOOD", + "distance_km": 0.74 }, { - "name": "NORTHFIELD", - "distance_km": 6.58 + "name": "CONTINNTAL", + "distance_km": 9.18 }, { - "name": "MONTRSE", - "distance_km": 7.9 + "name": "CLOVERDALE", + "distance_km": 10.5 } ] }, @@ -21849,44 +21849,44 @@ { "country": "US", "region": "OH", - "county": "Hamilton", + "county": "Columbiana", "name": "Salem Heights", - "lat": "39.0658", - "long": "-84.3840", + "lat": "40.9031", + "long": "-80.8871", "nearby_rate_centers": [ { - "name": "CLERMONT", - "distance_km": 7.21 + "name": "SALEM", + "distance_km": 2.93 }, { - "name": "CINCINNATI", - "distance_km": 11.92 + "name": "DAMASCUS", + "distance_km": 5.57 }, { - "name": "LTL MIAMI", - "distance_km": 24.86 + "name": "WINONA", + "distance_km": 7.77 } ] }, { "country": "US", "region": "OH", - "county": "Columbiana", + "county": "Hamilton", "name": "Salem Heights", - "lat": "40.9031", - "long": "-80.8871", + "lat": "39.0658", + "long": "-84.3840", "nearby_rate_centers": [ { - "name": "SALEM", - "distance_km": 2.93 + "name": "CLERMONT", + "distance_km": 7.21 }, { - "name": "DAMASCUS", - "distance_km": 5.57 + "name": "CINCINNATI", + "distance_km": 11.92 }, { - "name": "WINONA", - "distance_km": 7.77 + "name": "LTL MIAMI", + "distance_km": 24.86 } ] }, diff --git a/data/cities/us/ok.json b/data/cities/us/ok.json index a927b63..94b966f 100644 --- a/data/cities/us/ok.json +++ b/data/cities/us/ok.json @@ -2619,44 +2619,44 @@ { "country": "US", "region": "OK", - "county": "Cherokee", + "county": "Atoka", "name": "Caney", - "lat": "35.8352", - "long": "-94.8421", + "lat": "34.2357", + "long": "-96.2173", "nearby_rate_centers": [ { - "name": "TAHLEQUAH", - "distance_km": 14.6 + "name": "CADDO", + "distance_km": 13.47 }, { - "name": "STILWELL", - "distance_km": 19.89 + "name": "ATOKA", + "distance_km": 18.51 }, { - "name": "BARON", - "distance_km": 23.75 + "name": "WAPANUCKA", + "distance_km": 23.98 } ] }, { "country": "US", "region": "OK", - "county": "Atoka", + "county": "Cherokee", "name": "Caney", - "lat": "34.2357", - "long": "-96.2173", + "lat": "35.8352", + "long": "-94.8421", "nearby_rate_centers": [ { - "name": "CADDO", - "distance_km": 13.47 + "name": "TAHLEQUAH", + "distance_km": 14.6 }, { - "name": "ATOKA", - "distance_km": 18.51 + "name": "STILWELL", + "distance_km": 19.89 }, { - "name": "WAPANUCKA", - "distance_km": 23.98 + "name": "BARON", + "distance_km": 23.75 } ] }, diff --git a/data/cities/us/or.json b/data/cities/us/or.json index 57bd1c4..2a41cca 100644 --- a/data/cities/us/or.json +++ b/data/cities/us/or.json @@ -2607,44 +2607,44 @@ { "country": "US", "region": "OR", - "county": "Tillamook", + "county": "Multnomah", "name": "Fairview", - "lat": "45.4583", - "long": "-123.7927", + "lat": "45.5469", + "long": "-122.4390", "nearby_rate_centers": [ { - "name": "TILLAMOOK", - "distance_km": 3.93 + "name": "GRESHAM", + "distance_km": 5.1 }, { - "name": "BAY CITY", - "distance_km": 10.08 + "name": "CORBETT", + "distance_km": 12.84 }, { - "name": "GARIBALDI", - "distance_km": 14.74 + "name": "SUNNYSIDE", + "distance_km": 14.34 } ] }, { "country": "US", "region": "OR", - "county": "Multnomah", + "county": "Tillamook", "name": "Fairview", - "lat": "45.5469", - "long": "-122.4390", + "lat": "45.4583", + "long": "-123.7927", "nearby_rate_centers": [ { - "name": "GRESHAM", - "distance_km": 5.1 + "name": "TILLAMOOK", + "distance_km": 3.93 }, { - "name": "CORBETT", - "distance_km": 12.84 + "name": "BAY CITY", + "distance_km": 10.08 }, { - "name": "SUNNYSIDE", - "distance_km": 14.34 + "name": "GARIBALDI", + "distance_km": 14.74 } ] }, diff --git a/data/cities/us/pa.json b/data/cities/us/pa.json index 39d5b04..d1794d7 100644 --- a/data/cities/us/pa.json +++ b/data/cities/us/pa.json @@ -12778,28 +12778,6 @@ } ] }, - { - "country": "US", - "region": "PA", - "county": "Luzerne", - "name": "Georgetown", - "lat": "41.2271", - "long": "-75.8722", - "nearby_rate_centers": [ - { - "name": "WILKSBARRE", - "distance_km": 2.05 - }, - { - "name": "KINGSTON", - "distance_km": 5.52 - }, - { - "name": "MOUNTANTOP", - "distance_km": 5.79 - } - ] - }, { "country": "US", "region": "PA", @@ -12844,6 +12822,28 @@ } ] }, + { + "country": "US", + "region": "PA", + "county": "Luzerne", + "name": "Georgetown", + "lat": "41.2271", + "long": "-75.8722", + "nearby_rate_centers": [ + { + "name": "WILKSBARRE", + "distance_km": 2.05 + }, + { + "name": "KINGSTON", + "distance_km": 5.52 + }, + { + "name": "MOUNTANTOP", + "distance_km": 5.79 + } + ] + }, { "country": "US", "region": "PA", @@ -16339,44 +16339,44 @@ { "country": "US", "region": "PA", - "county": "York", + "county": "Greene", "name": "Jefferson", - "lat": "39.8156", - "long": "-76.8410", + "lat": "39.9304", + "long": "-80.0577", "nearby_rate_centers": [ { - "name": "JEFFERSON", - "distance_km": 0.12 + "name": "JEFFERSN", + "distance_km": 0.88 }, { - "name": "SPRING GRV", - "distance_km": 6.93 + "name": "RICES LDG", + "distance_km": 6.2 }, { - "name": "GLEN ROCK", - "distance_km": 9.74 + "name": "CARMICHALS", + "distance_km": 7.87 } ] }, { "country": "US", "region": "PA", - "county": "Greene", + "county": "York", "name": "Jefferson", - "lat": "39.9304", - "long": "-80.0577", + "lat": "39.8156", + "long": "-76.8410", "nearby_rate_centers": [ { - "name": "JEFFERSN", - "distance_km": 0.88 + "name": "JEFFERSON", + "distance_km": 0.12 }, { - "name": "RICES LDG", - "distance_km": 6.2 + "name": "SPRING GRV", + "distance_km": 6.93 }, { - "name": "CARMICHALS", - "distance_km": 7.87 + "name": "GLEN ROCK", + "distance_km": 9.74 } ] }, @@ -21301,44 +21301,44 @@ { "country": "US", "region": "PA", - "county": "Northampton", + "county": "Dauphin", "name": "Middletown", - "lat": "40.6440", - "long": "-75.3244", + "lat": "40.2010", + "long": "-76.7289", "nearby_rate_centers": [ { - "name": "BETHLEHEM", - "distance_km": 6.34 + "name": "MIDDLETOWN", + "distance_km": 0.5 }, { - "name": "HELLERTOWN", - "distance_km": 6.81 + "name": "HUMMELSTN", + "distance_km": 7.43 }, { - "name": "EASTON", - "distance_km": 9.53 + "name": "LEWISBERRY", + "distance_km": 7.82 } ] }, { "country": "US", "region": "PA", - "county": "Dauphin", + "county": "Northampton", "name": "Middletown", - "lat": "40.2010", - "long": "-76.7289", + "lat": "40.6440", + "long": "-75.3244", "nearby_rate_centers": [ { - "name": "MIDDLETOWN", - "distance_km": 0.5 + "name": "BETHLEHEM", + "distance_km": 6.34 }, { - "name": "HUMMELSTN", - "distance_km": 7.43 + "name": "HELLERTOWN", + "distance_km": 6.81 }, { - "name": "LEWISBERRY", - "distance_km": 7.82 + "name": "EASTON", + "distance_km": 9.53 } ] }, @@ -21675,44 +21675,44 @@ { "country": "US", "region": "PA", - "county": "Perry", + "county": "Blair", "name": "Millerstown", - "lat": "40.5543", - "long": "-77.1530", + "lat": "40.2771", + "long": "-78.3029", "nearby_rate_centers": [ { - "name": "MILLERSTN", - "distance_km": 0.76 + "name": "MARTINSBG", + "distance_km": 4.09 }, { - "name": "THOMPSONTN", - "distance_km": 7.69 + "name": "SAXTON", + "distance_km": 8.48 }, { - "name": "NEWPORT", - "distance_km": 8.96 + "name": "ROARINGSPG", + "distance_km": 11.37 } ] }, { "country": "US", "region": "PA", - "county": "Blair", + "county": "Perry", "name": "Millerstown", - "lat": "40.2771", - "long": "-78.3029", + "lat": "40.5543", + "long": "-77.1530", "nearby_rate_centers": [ { - "name": "MARTINSBG", - "distance_km": 4.09 + "name": "MILLERSTN", + "distance_km": 0.76 }, { - "name": "SAXTON", - "distance_km": 8.48 + "name": "THOMPSONTN", + "distance_km": 7.69 }, { - "name": "ROARINGSPG", - "distance_km": 11.37 + "name": "NEWPORT", + "distance_km": 8.96 } ] }, @@ -28627,44 +28627,44 @@ { "country": "US", "region": "PA", - "county": "Montgomery", + "county": "Blair", "name": "Red Hill", - "lat": "40.3771", - "long": "-75.4838", + "lat": "40.5296", + "long": "-78.4356", "nearby_rate_centers": [ { - "name": "PENNSBURG", - "distance_km": 2.97 + "name": "ALTOONA", + "distance_km": 3.55 }, { - "name": "GREEN LANE", - "distance_km": 4.08 + "name": "HOLLIDYSBG", + "distance_km": 11.26 }, { - "name": "SASSAMNSVL", - "distance_km": 8.79 + "name": "BELLWOOD", + "distance_km": 11.6 } ] }, { "country": "US", "region": "PA", - "county": "Blair", + "county": "Montgomery", "name": "Red Hill", - "lat": "40.5296", - "long": "-78.4356", + "lat": "40.3771", + "long": "-75.4838", "nearby_rate_centers": [ { - "name": "ALTOONA", - "distance_km": 3.55 + "name": "PENNSBURG", + "distance_km": 2.97 }, { - "name": "HOLLIDYSBG", - "distance_km": 11.26 + "name": "GREEN LANE", + "distance_km": 4.08 }, { - "name": "BELLWOOD", - "distance_km": 11.6 + "name": "SASSAMNSVL", + "distance_km": 8.79 } ] }, @@ -38129,44 +38129,44 @@ { "country": "US", "region": "PA", - "county": "Chester", + "county": "Cambria", "name": "Westwood", - "lat": "39.9702", - "long": "-75.8555", + "lat": "40.3331", + "long": "-78.9537", "nearby_rate_centers": [ { - "name": "COATESVL", - "distance_km": 3.55 + "name": "JOHNSTOWN", + "distance_km": 3.06 }, { - "name": "PARKESBURG", - "distance_km": 5.31 + "name": "NEWFLORNCE", + "distance_km": 10.51 }, { - "name": "MORTONVL", - "distance_km": 7.44 + "name": "SEWARD", + "distance_km": 10.56 } ] }, { "country": "US", "region": "PA", - "county": "Cambria", + "county": "Chester", "name": "Westwood", - "lat": "40.3331", - "long": "-78.9537", + "lat": "39.9702", + "long": "-75.8555", "nearby_rate_centers": [ { - "name": "JOHNSTOWN", - "distance_km": 3.06 + "name": "COATESVL", + "distance_km": 3.55 }, { - "name": "NEWFLORNCE", - "distance_km": 10.51 + "name": "PARKESBURG", + "distance_km": 5.31 }, { - "name": "SEWARD", - "distance_km": 10.56 + "name": "MORTONVL", + "distance_km": 7.44 } ] }, diff --git a/data/cities/us/pr.json b/data/cities/us/pr.json index 774a0aa..47b14d3 100644 --- a/data/cities/us/pr.json +++ b/data/cities/us/pr.json @@ -4007,44 +4007,44 @@ { "country": "US", "region": "PR", - "county": "Lajas", + "county": "Corozal", "name": "Palmarejo", - "lat": "18.0409", - "long": "-67.0766", + "lat": "18.3149", + "long": "-66.2925", "nearby_rate_centers": [ { - "name": "LAJAS", - "distance_km": 2.56 + "name": "COROZAL", + "distance_km": 4.14 }, { - "name": "SAN GERMAN", - "distance_km": 5.8 + "name": "NARANJITO", + "distance_km": 4.72 }, { - "name": "CABO ROJO", - "distance_km": 8.96 + "name": "TOA ALTA", + "distance_km": 9.12 } ] }, { "country": "US", "region": "PR", - "county": "Corozal", + "county": "Lajas", "name": "Palmarejo", - "lat": "18.3149", - "long": "-66.2925", + "lat": "18.0409", + "long": "-67.0766", "nearby_rate_centers": [ { - "name": "COROZAL", - "distance_km": 4.14 + "name": "LAJAS", + "distance_km": 2.56 }, { - "name": "NARANJITO", - "distance_km": 4.72 + "name": "SAN GERMAN", + "distance_km": 5.8 }, { - "name": "TOA ALTA", - "distance_km": 9.12 + "name": "CABO ROJO", + "distance_km": 8.96 } ] }, @@ -4843,44 +4843,44 @@ { "country": "US", "region": "PR", - "county": "Rincón", + "county": "Cidra", "name": "Rincón", - "lat": "18.3389", - "long": "-67.2515", + "lat": "18.1500", + "long": "-66.1569", "nearby_rate_centers": [ { - "name": "RINCON", - "distance_km": 0.84 + "name": "CIDRA", + "distance_km": 2.7 }, { - "name": "AGUADA", - "distance_km": 8.95 + "name": "CAYEY", + "distance_km": 4.31 }, { - "name": "AGUADILLA", - "distance_km": 10.58 + "name": "COMERIO", + "distance_km": 10.38 } ] }, { "country": "US", "region": "PR", - "county": "Cidra", + "county": "Rincón", "name": "Rincón", - "lat": "18.1500", - "long": "-66.1569", + "lat": "18.3389", + "long": "-67.2515", "nearby_rate_centers": [ { - "name": "CIDRA", - "distance_km": 2.7 + "name": "RINCON", + "distance_km": 0.84 }, { - "name": "CAYEY", - "distance_km": 4.31 + "name": "AGUADA", + "distance_km": 8.95 }, { - "name": "COMERIO", - "distance_km": 10.38 + "name": "AGUADILLA", + "distance_km": 10.58 } ] }, @@ -5151,44 +5151,44 @@ { "country": "US", "region": "PR", - "county": "Dorado", + "county": "Aguadilla", "name": "San Antonio", - "lat": "18.4471", - "long": "-66.2995", + "lat": "18.4932", + "long": "-67.0997", "nearby_rate_centers": [ { - "name": "DORADO", - "distance_km": 3.92 + "name": "RAMEY", + "distance_km": 3.53 }, { - "name": "VEGA ALTA", - "distance_km": 5.03 + "name": "ISABELA", + "distance_km": 7.94 }, { - "name": "TOA BAJA", - "distance_km": 7.2 + "name": "MOCA", + "distance_km": 10.87 } ] }, { "country": "US", "region": "PR", - "county": "Aguadilla", + "county": "Dorado", "name": "San Antonio", - "lat": "18.4932", - "long": "-67.0997", + "lat": "18.4471", + "long": "-66.2995", "nearby_rate_centers": [ { - "name": "RAMEY", - "distance_km": 3.53 + "name": "DORADO", + "distance_km": 3.92 }, { - "name": "ISABELA", - "distance_km": 7.94 + "name": "VEGA ALTA", + "distance_km": 5.03 }, { - "name": "MOCA", - "distance_km": 10.87 + "name": "TOA BAJA", + "distance_km": 7.2 } ] }, diff --git a/data/cities/us/sc.json b/data/cities/us/sc.json index c0ed4f1..481a99d 100644 --- a/data/cities/us/sc.json +++ b/data/cities/us/sc.json @@ -7423,48 +7423,48 @@ { "country": "US", "region": "SC", - "county": "Lexington", + "county": "Darlington", "name": "Pine Ridge", - "lat": "33.9082", - "long": "-81.0977", + "lat": "34.3927", + "long": "-80.1679", "nearby_rate_centers": [ { - "name": "COLUMBIA", - "distance_km": 12.74 - }, - { - "name": "W COLUMBIA", - "distance_km": 12.74 + "name": "HARTSVILLE", + "distance_km": 8.82 }, { - "name": "LEXINGTON", - "distance_km": 15.11 + "name": "MCBEE", + "distance_km": 11.91 }, { - "name": "SWANSEA", - "distance_km": 19.58 + "name": "BETHUNE", + "distance_km": 17.0 } ] }, { "country": "US", "region": "SC", - "county": "Darlington", + "county": "Lexington", "name": "Pine Ridge", - "lat": "34.3927", - "long": "-80.1679", + "lat": "33.9082", + "long": "-81.0977", "nearby_rate_centers": [ { - "name": "HARTSVILLE", - "distance_km": 8.82 + "name": "COLUMBIA", + "distance_km": 12.74 }, { - "name": "MCBEE", - "distance_km": 11.91 + "name": "W COLUMBIA", + "distance_km": 12.74 }, { - "name": "BETHUNE", - "distance_km": 17.0 + "name": "LEXINGTON", + "distance_km": 15.11 + }, + { + "name": "SWANSEA", + "distance_km": 19.58 } ] }, diff --git a/data/cities/us/sd.json b/data/cities/us/sd.json index f7b44d4..2451346 100644 --- a/data/cities/us/sd.json +++ b/data/cities/us/sd.json @@ -2051,44 +2051,44 @@ { "country": "US", "region": "SD", - "county": "Marshall", + "county": "Deuel", "name": "Clear Lake", - "lat": "45.6933", - "long": "-97.3572", + "lat": "44.7644", + "long": "-96.6768", "nearby_rate_centers": [ { - "name": "VEBLEN", - "distance_km": 20.18 + "name": "CLEAR LAKE", + "distance_km": 1.43 }, { - "name": "ROSLYN", - "distance_km": 23.69 + "name": "BRANDT", + "distance_km": 11.86 }, { - "name": "SISSETON", - "distance_km": 23.87 + "name": "GARY", + "distance_km": 18.09 } ] }, { "country": "US", "region": "SD", - "county": "Deuel", + "county": "Marshall", "name": "Clear Lake", - "lat": "44.7644", - "long": "-96.6768", + "lat": "45.6933", + "long": "-97.3572", "nearby_rate_centers": [ { - "name": "CLEAR LAKE", - "distance_km": 1.43 + "name": "VEBLEN", + "distance_km": 20.18 }, { - "name": "BRANDT", - "distance_km": 11.86 + "name": "ROSLYN", + "distance_km": 23.69 }, { - "name": "GARY", - "distance_km": 18.09 + "name": "SISSETON", + "distance_km": 23.87 } ] }, diff --git a/data/cities/us/tn.json b/data/cities/us/tn.json index a1431b7..039a39c 100644 --- a/data/cities/us/tn.json +++ b/data/cities/us/tn.json @@ -4503,44 +4503,44 @@ { "country": "US", "region": "TN", - "county": "Lauderdale", + "county": "Knox", "name": "Halls", - "lat": "35.8795", - "long": "-89.4050", + "lat": "36.0817", + "long": "-83.9344", "nearby_rate_centers": [ { - "name": "HALLS", - "distance_km": 1.34 + "name": "HLSCRSSRDS", + "distance_km": 1.46 }, { - "name": "FRIENDSHIP", - "distance_km": 14.74 + "name": "POWELL", + "distance_km": 11.09 }, { - "name": "MAURY CITY", - "distance_km": 17.68 + "name": "KNOXVILLE", + "distance_km": 12.54 } ] }, { "country": "US", "region": "TN", - "county": "Knox", + "county": "Lauderdale", "name": "Halls", - "lat": "36.0817", - "long": "-83.9344", + "lat": "35.8795", + "long": "-89.4050", "nearby_rate_centers": [ { - "name": "HLSCRSSRDS", - "distance_km": 1.46 + "name": "HALLS", + "distance_km": 1.34 }, { - "name": "POWELL", - "distance_km": 11.09 + "name": "FRIENDSHIP", + "distance_km": 14.74 }, { - "name": "KNOXVILLE", - "distance_km": 12.54 + "name": "MAURY CITY", + "distance_km": 17.68 } ] }, diff --git a/data/cities/us/tx.json b/data/cities/us/tx.json index b904244..5ed9a01 100644 --- a/data/cities/us/tx.json +++ b/data/cities/us/tx.json @@ -6984,6 +6984,28 @@ } ] }, + { + "country": "US", + "region": "TX", + "county": "Cameron", + "name": "Chula Vista", + "lat": "26.0739", + "long": "-97.4397", + "nearby_rate_centers": [ + { + "name": "LOSFRESNOS", + "distance_km": 3.28 + }, + { + "name": "BROWNSVL", + "distance_km": 19.13 + }, + { + "name": "SAN BENITO", + "distance_km": 20.33 + } + ] + }, { "country": "US", "region": "TX", @@ -7028,28 +7050,6 @@ } ] }, - { - "country": "US", - "region": "TX", - "county": "Cameron", - "name": "Chula Vista", - "lat": "26.0739", - "long": "-97.4397", - "nearby_rate_centers": [ - { - "name": "LOSFRESNOS", - "distance_km": 3.28 - }, - { - "name": "BROWNSVL", - "distance_km": 19.13 - }, - { - "name": "SAN BENITO", - "distance_km": 20.33 - } - ] - }, { "country": "US", "region": "TX", @@ -22807,44 +22807,44 @@ { "country": "US", "region": "TX", - "county": "Starr", + "county": "Jim Wells", "name": "Loma Linda East", - "lat": "26.3281", - "long": "-98.6894", + "lat": "27.7663", + "long": "-98.1942", "nearby_rate_centers": [ { - "name": "SULLIVANCY", - "distance_km": 14.19 + "name": "SAN DIEGO", + "distance_km": 4.47 }, { - "name": "RIGRANDECY", - "distance_km": 14.69 + "name": "ALICE", + "distance_km": 12.88 }, { - "name": "EL SAUZ", - "distance_km": 32.92 + "name": "AGUA DULCE", + "distance_km": 28.36 } ] }, { "country": "US", "region": "TX", - "county": "Jim Wells", + "county": "Starr", "name": "Loma Linda East", - "lat": "27.7663", - "long": "-98.1942", + "lat": "26.3281", + "long": "-98.6894", "nearby_rate_centers": [ { - "name": "SAN DIEGO", - "distance_km": 4.47 + "name": "SULLIVANCY", + "distance_km": 14.19 }, { - "name": "ALICE", - "distance_km": 12.88 + "name": "RIGRANDECY", + "distance_km": 14.69 }, { - "name": "AGUA DULCE", - "distance_km": 28.36 + "name": "EL SAUZ", + "distance_km": 32.92 } ] }, @@ -29322,6 +29322,28 @@ } ] }, + { + "country": "US", + "region": "TX", + "county": "Cameron", + "name": "Palmer", + "lat": "26.0703", + "long": "-97.6342", + "nearby_rate_centers": [ + { + "name": "SAN BENITO", + "distance_km": 7.02 + }, + { + "name": "HARLINGEN", + "distance_km": 13.96 + }, + { + "name": "LOSFRESNOS", + "distance_km": 16.16 + } + ] + }, { "country": "US", "region": "TX", @@ -29356,28 +29378,6 @@ } ] }, - { - "country": "US", - "region": "TX", - "county": "Cameron", - "name": "Palmer", - "lat": "26.0703", - "long": "-97.6342", - "nearby_rate_centers": [ - { - "name": "SAN BENITO", - "distance_km": 7.02 - }, - { - "name": "HARLINGEN", - "distance_km": 13.96 - }, - { - "name": "LOSFRESNOS", - "distance_km": 16.16 - } - ] - }, { "country": "US", "region": "TX", diff --git a/data/cities/us/va.json b/data/cities/us/va.json index 7ea618e..dffa2ef 100644 --- a/data/cities/us/va.json +++ b/data/cities/us/va.json @@ -1975,44 +1975,44 @@ { "country": "US", "region": "VA", - "county": "Prince William", + "county": "Fairfax", "name": "Bull Run", - "lat": "38.7802", - "long": "-77.5204", + "lat": "38.8396", + "long": "-77.4897", "nearby_rate_centers": [ { - "name": "MANASSAS", - "distance_km": 4.92 + "name": "BRADDOCK", + "distance_km": 5.36 }, { - "name": "HAYMARKET", - "distance_km": 10.25 + "name": "MANASSAS", + "distance_km": 9.95 }, { - "name": "NOKESVILLE", - "distance_km": 10.33 + "name": "HAYMARKET", + "distance_km": 12.77 } ] }, { "country": "US", "region": "VA", - "county": "Fairfax", + "county": "Prince William", "name": "Bull Run", - "lat": "38.8396", - "long": "-77.4897", + "lat": "38.7802", + "long": "-77.5204", "nearby_rate_centers": [ - { - "name": "BRADDOCK", - "distance_km": 5.36 - }, { "name": "MANASSAS", - "distance_km": 9.95 + "distance_km": 4.92 }, { "name": "HAYMARKET", - "distance_km": 12.77 + "distance_km": 10.25 + }, + { + "name": "NOKESVILLE", + "distance_km": 10.33 } ] }, diff --git a/lib/rate_center/data_prep.rb b/lib/rate_center/data_prep.rb index 7d5f761..bbcd025 100644 --- a/lib/rate_center/data_prep.rb +++ b/lib/rate_center/data_prep.rb @@ -73,7 +73,7 @@ def update_cities_with_nearby_rate_centers end def find_closest(lat:, long:, data:, key:) - distance_to = Class.new(Struct.new(:name, :distance, keyword_init: true)) + distance_to = Struct.new(:name, :distance, keyword_init: true) distances_to = Array(data).map do |d| distance_to.new( diff --git a/lib/rate_center/data_source/simple_maps.rb b/lib/rate_center/data_source/simple_maps.rb index a5b93ca..784902b 100644 --- a/lib/rate_center/data_source/simple_maps.rb +++ b/lib/rate_center/data_source/simple_maps.rb @@ -75,7 +75,7 @@ def load_data!(**options) cities_by_state.each do |state, cities| data_file = data_directory.join("#{state.downcase}.json") - data = cities.sort_by { |city| [ city.city, city.county ] }.map do |city| + data = cities.sort_by { |city| [ city.city, city.county_name ] }.map do |city| { "country" => "US", "region" => city.state_id,