Not sure if reopening #175193: Zip code database out of date makes sense at this point, but the zipcodes.us.mysql file still has holes. As one specific example, the 10065 zipcode on the Upper East Side of New York City isn't there. All you get are:

('10060', 'New York', 'NY', '40.780751', '-73.977182', -5, 1, 'us'),
('10069', 'New York', 'NY', '40.775477', '-73.990500', -5, 1, 'us'),
('10072', 'New York', 'NY', '40.780751', '-73.977182', -5, 1, 'us'),
('10079', 'New York', 'NY', '40.780751', '-73.977182', -5, 1, 'us'),

I don't know how to reliably find all the zip codes to compare what's in the DB with reality, but clearly 10065 is missing. Should I just open separate issues for any zipcodes I find that are missing? Is manually keeping this file accurate really the strategy here?

Thanks,
-Derek

CommentFileSizeAuthor
#1 1460880-1.NY-zipcode-fixes.patch1.43 KBdww
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dww’s picture

Assigned: Unassigned » dww
Status: Active » Needs review
FileSize
1.43 KB

Based on http://www.zip-codes.com/zip-code/10065/zip-code-10065.asp and http://www.zip-codes.com/zip-code/10075/zip-code-10075.asp here's a patch to add two of the missing zip codes. Some of the other entries for NY seem bogus, but I'm not sure about removing existing entries that no longer appear to correspond with actual zip codes. Also, some of the lat/lon data in the file doesn't match what's listed on this site, but I'm not sure how reliable that site is, either. So, let's at least start with this. I guess we don't need a hook_update_N() to insert missing records, right, since the idea is that people would just drop and rebuild the table or something?

ankur’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for the data correction. The original data was extracted from some 2000 Census files, by Schuyler Erle, the person that offers the geocoding service at http://geocoder.us

I do, however, have mixed thoughts on this.

On one hand, I'd like to avoid maintaining zipcode data on Drupal.org's servers. I'm not sure if I remember the internals of git correctly, but whenever a file is modified, rather than storing just the differential, git stores the entire new revision of the file, correct? I guess that wouldn't be too much of an issue if compression is being used.

There's a similar thread on this for UK postcodes: #765564: Full UK zipcodes mysql file using Google

I think, in the future, the best way to go would be to try to have this data hosted elsewhere.

For now, maybe we can take the middle road of allowing changes to existing zipcode data files, but not allowing the addition of new ones.

In any case, I'm thinking that, if you have commit access for this project, you can just go ahead and push this change through (while also merging it to the 7.x-3.x and 7.x-5.x branches). Also, let's leave this stuff out of the .install files.

dww’s picture

Git is very efficient at storing changes. It stores diffs. It even tries to store diffs on binary files. Don't worry about that. ;)

But yeah, it is a can of worms trying to keep this data accurate. :/ Not sure the best long term solution for that.

Duly noted on leaving these changes out of the .install file.

I'll push to all relevant branches of location later today. In the middle of a bunch of other stuff right now.

podarok’s picture

Status: Reviewed & tested by the community » Postponed

postponed before tests fix
#1931088: [META] Fixing tests

podarok’s picture

Status: Postponed » Needs review

tests fixed #1931088: [META] Fixing tests
lets go

podarok’s picture

Status: Needs review » Fixed

#1 commited pushed to 6.x-3.x
thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

dww’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Status: Closed (fixed) » Patch (to be ported)

Cool, thanks. This fell off my radar (obviously). ;) Shouldn't we merge this to the D7 branches, too?

Thanks,
-Derek

podarok’s picture

Category: bug » task
Status: Patch (to be ported) » Needs work

patch are welcome

dww’s picture

Status: Needs work » Reviewed & tested by the community

Question is do you want to use Git merge or do you want to just commit the same fix to multiple branches? If you just want to commit, the patch in #1 still applies cleanly to both 7.x-3.x and 7.x-5.x.

Thanks!
-Derek

podarok’s picture

#1: 1460880-1.NY-zipcode-fixes.patch queued for re-testing.

podarok’s picture

Status: Reviewed & tested by the community » Fixed

commited pushed to 7.x-3.x
thanks!!!

dww’s picture

Thank you!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.