Skip to content

Multiple Tiles / Zip files #13

Description

@Dave13h

Hi,

Great package, very useful. I have a slight issue though, when there are multiple zip files coming from imagico it only seems to process the first one..

https://github.com/perliedman/node-hgt/blob/master/src/imagico.js#L32

Then it throws an error trying to read a file from the 2nd zip file. For example using..

[44.81211, 6.172401], [45.8805, 6.553799].

Two files are returned from imagico..

[{"name":"L31.zip","title":"","link":"http:\/\/www.viewfinderpanoramas.org\/dem3\/L31.zip","date":"2012-08-05","lon_start":"0","lat_start":"44","lon_end":"6","lat_end":"48","type":"2"},{"name":"L32.zip","title":"","link":"http:\/\/www.viewfinderpanoramas.org\/dem3\/L32.zip","date":"2012-08-05","lon_start":"6","lat_start":"44","lon_end":"12","lat_end":"48","type":"2"}]

A quick work around that seems to work is

var last;
for (var z in tileZips) {
    tempPath = path.join(os.tmpdir(), tileZips[z].name);
    stream = fs.createWriteStream(tempPath);
    last = this._download(tileZips[z].link, stream);
}
return last;

I'm sure this isn't the most elegant solution :P

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions