/ms-building-import

https://wiki.openstreetmap.org/wiki/Microsoft_Building_Footprint_Data

Primary LanguageHTML

ms-building-import

This repository showcases the Microsoft's 9.8 million US buildings in Mapbox GL JS which is licensed under ODbL. The dataset contains both building shapes and height information all major cities in 45 US states. The visualise in Mapbox Studio, we converted shape files -> geojson -> mbtiles.

Data extraction and conversion

  • All the state data were in shapefile format. This data needs conversion and cleanup to visualise better. There are the 3 steps to follow.

Step 1. Convert shape file to GeoJSON

  • Download [ogr2ogr](https://trac.osgeo.org/gdal/wiki/DownloadingGdalBinaries) and install it based on the Operating system you are using.
  • Download the building dataset, unzip the contents, and enter into the state folder in your terminal.
  • Use ogr2ogr to convert the shapefile to GeoJSON.

ogr2ogr -f GeoJSON -t_srs crs:84 state_name.geojson *.shp

E.g. For Florida state,

`ogr2ogr -f GeoJSON -t_srs crs:84 state_name.geojson *.shp`

Step 2: Generate mbtiles from GeoJSON using tippecanoe

tippecanoe -fo state_name.mbtiles -l custom -z12 -Z12 state_name.geojson

  • If you want to append all states GeoJSON to a single mbtiles use -F option of tippecanoe. Make sure you've given common output mbtiles and change the input GeoJSON file.

tippecanoe -Fo microsoft-buildings.mbtiles -l custom -z12 -Z12 state_name.geojson

Step 3: Upload mbtiles to Mapbox Studio

  • Create Mapbox Studio account
  • Upload mbtiles in Tilesets section and visualise them.