Skip to content

check file_path before dowload begins in getRaster #66

@geryan

Description

@geryan

feature request

Hi MAP team!

If file_path is somehow misspecified,getRaster only fails at the end of a long slow download. Annoying for me, I suspect VV frustrating for colleagues with less good internet.

Something like stopifnot(dir.exists(file_path) at the beginning of the function should solve this.

Related: the writeRaster(...... overwrite = FALSE) hard coding would also lead to (unnecessary) failure after a long download if the file already existed. Checking if the target file exists before downloading would be kind - this is how geodata::gadm operates, i.e., if files exist it just reads them in instead of re-downloading.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions