[OSM-talk] all our addresses are belong to you

Jeffrey Ollie jeff at ocjtech.us
Thu Mar 3 17:16:25 GMT 2011


Here's my modifications to the code...  The original code will fail on
lines like this:

critical_address_file_us.csv:"3424 Peachtree Rd,
NE",US,GA,Atlanta,30326,3424,3424,33851200,-84363500
critical_address_file_us.csv:"3424 Peachtree Road,
NE",US,GA,Atlanta,30326,3424,3424,33851200,-84363500

Because it doesn't take into account the quoting when splitting the
file.  Using the csv module takes care of that.  I was also getting
some invalid XML so I switched to using LXML to build the XML to
ensure well-formedness.  The files are small enough that building the
whole XML tree in memory isn't a problem.  I also perform a few data
cleanups as well and split the US out into individual states.

One thing that I noticed about the data is that there are several
Canadian addresses in the US file.

-- 
Jeff Ollie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mqcaf_to_osm.py
Type: application/x-download
Size: 3515 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/talk/attachments/20110303/02f6b249/attachment-0001.bin>


More information about the talk mailing list