Bulk upload sax.py

From OpenStreetMap Wiki
Jump to: navigation, search

For huge imports where the XML file is too big for the default script (e.g. the Corine Land Cover France with 1.4 GB single file), a special version of Bulk upload.py has been created in July 2009 to replace the DOM parsing loading the whole file in memory by the SAX parsing. Also, the translation table of old_id's to new_id's is stored in the *.osm.db file with the Python "shelve" persistence library (for performance reasons).

A second version of the script introduces an automatic retry in case of http error 500 ("Internal server error"), the most common error stoping bulk imports.

You can find the script here in svn.

See also