├── README.md └── index.html /README.md: -------------------------------------------------------------------------------- 1 | # ms-building-import 2 | 3 | This repository showcases the [Microsoft's 9.8 million](https://wiki.openstreetmap.org/wiki/Microsoft_Building_Footprint_Data 4 | ) US buildings in Mapbox GL JS which is licensed under [ODbL](https://wiki.openstreetmap.org/wiki/Open_Database_License). 5 | 6 | The dataset contains both building geometry and height information major cities in 44 US states. To visualise in Mapbox Studio, we converted the 7 | `Shapefiles -> GeoJSON -> MBTiles`. 8 | 9 | ### Data extraction and conversion 10 | All the state data were in [shapefile format](https://wiki.openstreetmap.org/wiki/Microsoft_Building_Footprint_Data#Data_Catalog). This data needs conversion and cleanup to visualise better. There are the 3 steps to follow. 11 | 12 | #### Step 1. Convert shape file to GeoJSON 13 | - Install [ogr2ogr](https://trac.osgeo.org/gdal/wiki/DownloadingGdalBinaries). 14 | - Download and extract the compressed file. 15 | - Use `ogr2ogr` to convert the shapefile to GeoJSON. 16 | 17 | `ogr2ogr -f GeoJSON -t_srs EPSG:4326 output.geojson input.shp` 18 | 19 | #### Step 2: Generate mbtiles from GeoJSON using tippecanoe 20 | - Generate MBTiles using [Tippecanoe](https://github.com/mapbox/tippecanoe), 21 | 22 | `tippecanoe -fo outout.mbtiles -l custom -z12 -Z12 state_name.geojson` 23 | 24 | - If you want to append all states GeoJSON to a single MBTiles use the `-F` option of Tippecanoe. 25 | Make sure you've given common output mbtiles and change the input GeoJSON file. 26 | 27 | `tippecanoe -Fo output.mbtiles -l custom -z12 -Z12 state_name.geojson` 28 | 29 | #### Step 3: Upload MBTiles to Mapbox Studio 30 | - Create [Mapbox Studio](https://www.mapbox.com/signup/) account 31 | - Upload the MBTiles in `Tilesets` section and visualise them. 32 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 51 | 52 | 53 | 54 | --------------------------------------------------------------------------------