0

Mapbox provides a kindle of map tiles--mapbox.mapbox-terrain-v2 which is stored in pbf format and saved in mvt suffix. The height data is represented by contour (line). I want to generate terrain with satellite texture and this height data in Unity3D. How could I convert this pbf data to a height map(a pixel for a height value)?

There is an example https://api.mapbox.com/v4/mapbox.mapbox-terrain-v2/12/1171/1566.jpg?access_token=pk.eyJ1Ijoib2xlb3RpZ2VyIiwiYSI6ImZ2cllZQ3cifQ.2yDE9wUcfO_BLiinccfOKg

And the mvt file https://api.mapbox.com/v4/mapbox.mapbox-terrain-v2/12/1171/1566.mvt?access_token=pk.eyJ1Ijoib2xlb3RpZ2VyIiwiYSI6ImZ2cllZQ3cifQ.2yDE9wUcfO_BLiinccfOKg

And the document of Mapbox: https://www.mapbox.com/vector-tiles/mapbox-terrain/

https://www.mapbox.com/vector-tiles/specification/

oleotiger
  • 105
  • 2
  • 11

2 Answers2

1

MapBox have buid a Unity3d package: MapBox-Unity-SDK

SDK here : https://www.mapbox.com/unity/

Just click download. This is an asset you can open in Unity directly.

Launch Unity3d, goto Menu>Assets>ImportPackage>CustomPackage and select your downloaded file.

It will unpack some files and the folders, you will find into some exemples scene files to help you.

KBill
  • 166
  • 1
  • 12
0

The current vector terrain layer isn't designed to be turned into a heightmap: we've processed terrain into elevation contours and lines, so turning those back into raw data would be difficult (much like doing the opposite: we do a lot of processing because it would also be difficult to transfer raw data and derive visual data).

A new and improved vector terrain model that supports your usecase is on the way, but we've also introduced RGB terrain, which was actually designed specifically to address cases like Unity - decoding the RGB-encoded elevation tiles tends to be much simpler in software.

tmcw
  • 11,536
  • 3
  • 36
  • 45