You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WHERE abbr = '#{state_abbr}' OR name = '#{escape_single_quotes(state_name)}'"
defget_state_id(state_abbr,state_name)sql="SELECT id FROM states WHERE abbr = '#{state_abbr}' and name = '#{escape_single_quotes(state_name)}'"res=select_first(sql)if(res == nil)sql="SELECT id FROM states WHERE name = '#{escape_single_quotes(state_name)}'"res=select_first(sql)endreturnresend
The fallback to test only for name is required because of mixed up state_abbr in Denmark's data (One State (Region) has two abbr's for the same state name i.e the state has one name but falsely in the dataset two abbr's, (More of data a date quality issue) and perhaps other countries as well.
EDIT: Perhaps using country_id in the state_id lookup would be better...
BTW South Africa does not have a adm1 (state) so I used country for state like this
Expected Behavior
All countries states are not mixed up
Actual Behavior
Some countries states are mixed up (For instance 82 for state_abbr)
Steps to reproduce the problem
Run without specifying a country
insert
-d' '
with CTRL+V TAB
These adm1 share 82 as abbr: (As example)
Çankiri
Khulna Division
Královéhradecký kraj
Phang Nga
Pomerania
Region Midtjylland
A possible workaround
Instead of
free_zipcode_data/lib/free_zipcode_data/db_table.rb
Line 48 in 292a336
The fallback to test only for name is required because of mixed up state_abbr in Denmark's data (One State (Region) has two abbr's for the same state name i.e the state has one name but falsely in the dataset two abbr's, (More of data a date quality issue) and perhaps other countries as well.
EDIT: Perhaps using country_id in the state_id lookup would be better...
BTW South Africa does not have a adm1 (state) so I used country for state like this
The text was updated successfully, but these errors were encountered: