Skip to content

osmlab/ms-building-import

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

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 geometry and height information major cities in 44 US states. To visualise in Mapbox Studio, we converted the Shapefiles -> 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

  • Install ogr2ogr.
  • Download and extract the compressed file.
  • Use ogr2ogr to convert the shapefile to GeoJSON.

ogr2ogr -f GeoJSON -t_srs EPSG:4326 output.geojson input.shp

Step 2: Generate mbtiles from GeoJSON using tippecanoe

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

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

tippecanoe -Fo output.mbtiles -l custom -z12 -Z12 state_name.geojson

Step 3: Upload MBTiles to Mapbox Studio

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