gis - Custom DEM for 3D Terrain in Mapbox iOS SDK v11+ - Stack Overflow

I've been testing bringing a custom DEM into my iOS app, which uses the Mapbox SDK. Anyone have su

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744221070a4563784.html

相关推荐

  • gis - Custom DEM for 3D Terrain in Mapbox iOS SDK v11+ - Stack Overflow

    I've been testing bringing a custom DEM into my iOS app, which uses the Mapbox SDK. Anyone have su

    9天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信