Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Tiles / Zip files #13

Open
Dave13h opened this issue Jul 19, 2016 · 0 comments
Open

Multiple Tiles / Zip files #13

Dave13h opened this issue Jul 19, 2016 · 0 comments

Comments

@Dave13h
Copy link

Dave13h commented Jul 19, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant