- Fetch the .gz from https://sites.research.google/open-buildings/#download
- Unzip it
- Get your max and min lat-long values. You can use https://geojson.io or any other tool
- Populate them in the top lines in the -bounds python script. Take care not to put min in max etc.
- Change the filename values as appropriate
- Run the -bounds python script
- You'll see the output CSV file
- Open QGIS
- Menu > Layer > Add Layer > Add Delimited Text Layer
- Select the file, make sure WKT / Well Known Text option is chosen. Press Add
- Now you see your shapes in QGIS map
- Right-click layer, Export
- Export to Geojson or the shapefile format of your choice
- Fetch the .gz from https://sites.research.google/open-buildings/#download
- Unzip it
- Draw the area you want in https://geojson.io (single shape only, modify the script if you do multi-polygon etc), and save the file as .geojson
pip install shapely
- Change the filename values at top
- Run the -polygon python script
- You'll see the output CSV file
- Open QGIS
- Menu > Layer > Add Layer > Add Delimited Text Layer
- Select the file, make sure WKT / Well Known Text option is chosen. Press Add
- Now you see your shapes in QGIS map
- Right-click layer, Export
- Export to Geojson or the shapefile format of your choice
- This takes the centroid lat-long which are the first two columns in the source CSV data, and does a lat-long comparison (for bounds) or point-in-polygon operation (for polygon) on every line. Dumps the matching ones into output file
- The scripts loads and processes only one line at a time, so should work on the very large CSV files on regular / entry-level laptops etc also. Let me know if that's not happening for you.
- All mentioned files must be located in the same folder and this script also in that same folder. Else put in folder paths as needed.