admin管理员组文章数量:1401643
I've been testing bringing a custom DEM into my iOS app, which uses the Mapbox SDK. Anyone have success bringing their own DEM sources into a Mapbox application?
Current approach:
I created my own RGB encoded DEM using the Mapbox formula (height = -10000 + ((R * 256 * 256 + G * 256 + B) * 0.1) and uploaded it to Mapbox Studio as a raster layer. Then I updated my codebase to use it instead of the Mapbox DEM when 3D is toggled on.
Results:
Terrain is added to the map, but it is wildly exaggerated. Mountains are massive towers, probably hundreds of KM tall. As a hack, I tried reducing terrain exaggeration to .01x. This was only slightly better, as it nearly flattened them. Iterative exaggeration values of 0.1x and 0.05x resulted in more wild spikes, so I thought I'd park that line of exploration and poke around for advice.
Any ideas?
if !mapView.mapboxMap.sourceExists(withId: "my-custom-dem") {
var source = RasterDemSource(id: "my-custom-dem")
source.url = "mapbox://username.my-custom-dem"
source.encoding = .mapbox // Tells Mapbox how to decode the RGB values
source.maxzoom = 16.0
source.minzoom = 0.0 // Allow full zoom range from 0-16
本文标签: gisCustom DEM for 3D Terrain in Mapbox iOS SDK v11Stack Overflow
版权声明:本文标题:gis - Custom DEM for 3D Terrain in Mapbox iOS SDK v11+ - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744221070a2595868.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论