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

Separate downloading and filtering in NPM commands? #340

Open
gibranparvez opened this issue Mar 29, 2018 · 6 comments
Open

Separate downloading and filtering in NPM commands? #340

gibranparvez opened this issue Mar 29, 2018 · 6 comments

Comments

@gibranparvez
Copy link

Since downloading and filtering are separate steps, perhaps there should be a separate npm command for filtering? Though in many use cases it might be redundant, it is a tad unclear what npm run download actually does.

@orangejulius
Copy link
Member

I like this idea, since, as I understand it, right now there's no way to updated the downloaded whosonfirst sqlite file besides manually deleting it. Exposing more clearly defined "download new data" and "extract using existing data" seems nice.

@missinglink
Copy link
Member

missinglink commented Mar 29, 2018

I would support this, the new SQLite code is designed in a way which can fairly easy accommodate this.

We would not be able to change the existing behaviour for npm run download because code is relying on that, but 👍 for adding additional commands.

@missinglink
Copy link
Member

If we do this, I'd also like to move this code somewhere else: https://github.com/pelias/whosonfirst/blob/master/utils/download_data.js#L17-L50

It got kind of messy and I regret it being piled in that file when it could be in its own file.

@orangejulius
Copy link
Member

This would be increasingly helpful now, as the WOF team has now automated pushing updates to the sqlite files. They therefore change quite regularly, and downloading many GB of database file might not always be desired.

@missinglink
Copy link
Member

The existing code checks the timestamp on disk vs the timestamp on the server and doesn't re-download data if it's not required.

@orangejulius
Copy link
Member

@missinglink that's exactly the point. Sometimes a user might be in a low/no-internet situation, or not want to bother re-downloading, but still want to extract a new set of data from the existing sqlite DB.

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

No branches or pull requests

3 participants