I finally got around to writing the zipcode loader I've been mumbling about since before the 3.0 development cycle.

It's a bit rough around the edges, but it works for me.

I'd like a bit of feedback before I put it in.

Thanks!

CommentFileSizeAuthor
location-ziploader.patch9.1 KBbdragon
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

greggles’s picture

This seems like it would be helpful, but I feel like there are a couple things to consider strongly:

1. Downloading and executing scripts is kind of dangerous, given DNS poisoning. It would be nice if the files could come from somewhere with https and a real certificate.
2. I'm not sure why it needs to write the tempfile, but that also feels a little weird to me. Is it not possible to loop over the $result->data?

bdragon’s picture

Scripts? It's just tabular data.

The temp file thing is a workaround for php4 not having a csv parser that reads from a string.

greggles’s picture

Scripts is the wrong word, but helps illustrate the point. You hope it's tabular data. If someone changes the DNS lookup result it becomes...whatever that person wants.

Why not just ship with the data and write code to load it from the local server? It's not _that_ big.

bdragon’s picture

The data shouldn't be in CVS anyway, as it's definately NOT GPL.

Also, it IS pretty big, the US alone is 2.3 megs (was 3.8 megs as the sql file), and most people won't be loading it anyway. I've only loaded zipcode data a few times for all the times I've deployed it....

It's easy enough to add an upload field or whatever.

Good point on the arbitrary data, should probabaly fuzz the zipcode table some time to make sure nothing's using it raw. :P

Cyberwolf’s picture

Can't the data about cities be considered as public domain content? It's just facts about each city, I don't think there is any intellectual property involved in this case.
Public domain is compatible with the GPL so I don't think it can be a problem to include those files in CVS.

I vote for including them in CVS, but have a fallback to update them from one or more servers. The servers should be configurable, so people who are anxious about security can set up their own servers for this purpose.

IMHO the current SQL-file based solution is certainly something that should be deprecated as soon as possible.

Cyberwolf’s picture

Would it be somehow possible maybe to integrate with GeoNames? Either through their web services or through their dumps.

Edit: seems like asked already here: http://drupal.org/node/75459

podarok’s picture

Status: Needs review » Active

bot recall

podarok’s picture

Assigned: bdragon » Unassigned
Status: Active » Needs review

bot

Status: Needs review » Needs work

The last submitted patch, location-ziploader.patch, failed testing.

legolasbo’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)

Closing old D6 issues as D6 is end of life