[OSM-dev] Problems with planet files and bz2

Oliver Tonnhofer olt at omniscale.de
Wed Mar 2 06:38:03 GMT 2011


On 02.03.2011, at 00:34, Eric Wolf wrote:

> Yep. That is the problem. Figured it out from both sides of the equation.
> 
> As of Python 2.7.1 and 3.2, the BZ2File object type does not support reading multi-stream bz2 files, like those generated by pbzip2.
> 
> I'm going to have to look into another solution.


You can use these lines:

def bzip_reader(filename):
    p = subprocess.Popen(['bunzip2', '-c', filename], bufsize=-1, stdout=subprocess.PIPE)
    return p.stdout

https://bitbucket.org/olt/imposm.parser/src/c7e1cd122f00/imposm/parser/util.py#cl-28

Regards,
Oliver

-- 
Oliver Tonnhofer    | Omniscale GmbH & Co KG    | http://omniscale.de
http://mapproxy.org | https://bitbucket.org/olt





More information about the dev mailing list