opengeos / open-buildings

Tools for working with open building datasets
https://opengeos.github.io/open-buildings
Other
123 stars 17 forks source link

Add function to download Google Building CSV's from cloud and unzip them. #8

Open cholmes opened 1 year ago

cholmes commented 1 year ago

Description

It'd be a nice helper method to just do a one-liner to grab a csv and use it locally. Could be interesting to investigate just being able to use a csv id in the CLI and download and convert in one step, in the convert function.

giswqs commented 1 year ago

It seems Google does not provide a CSV with a list of links to each zip file. I have to click on a polygon on the map to get the download URL. https://sites.research.google/open-buildings/#download

With the URLs, leafmap.download_file() and download_files() can download the files easily without gsutil. https://leafmap.org/common/#leafmap.common.download_file

And it would be nice to have CLI commands to download the files as well.

cholmes commented 1 year ago

Ah cool. And yes, agree that a CLI command to download would be great. Indeed probably a better pattern to keep it separate from convert, and maybe let the cli take stdnin - open_buildings download 2e7.csv | open_buildings convert - output_dir/

It looks like there's a json file with the url's - https://sites.research.google/open-buildings/tiles.geojson

giswqs commented 1 year ago

Thank you for the link. I did not notice that.

I have added a Python example for downloading the dataset. https://opengeos.github.io/open-buildings/examples/download_buildings/