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
.
- All the state data were in shapefile format. This data needs conversion and cleanup to visualise better. There are the 3 steps to follow.
- 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`
- Generate mbtiles 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
- Create Mapbox Studio account
- Upload mbtiles in
Tilesets
section and visualise them.