Mapbox-gl-js: Support extrusion heights over 65km

Created on 11 Jan 2017  Â·  7Comments  Â·  Source: mapbox/mapbox-gl-js

Hello,
I'm trying to create a 3D hexbin map, similar to the example you showed a while ago (https://www.mapbox.com/bites/00304/). I'm trying to do this at a country level rather than city level. I tried to raise the fill-extrusion-height to an appropriate level, as this is set in meters I'd need something in the region of 300+Km but I guess I'm hitting a limitation and I can really go above ~50Km. Do you think that this could be an error on my behalf or this is indeed a limitation perhaps do to the type of Integer that is used to set the fill-extrusion-height?

feature

Most helpful comment

Let's keep this open — there's a chance we could add support for higher values while not sacrificing memory requirements, e.g. by introducing a multiplier spec property. That way you could control the height range at the expense of precision (e.g. have fill-extrusion-multiplier: 10 would allow going up to 655km but with 10m increments instead of 1m).

This use case seems quite common — every extrusion-based visualization that's on a bigger scale than city level (e.g. counties, countries) will need bigger values supported.

All 7 comments

@lcapel yes, fill-extrusion-height uses a Uint16 type, so the maximum possible value is 65535. At the moment we don't have plans to use bigger numbers as the increase in memory usage would be substantial for what seems to be a pretty limited use case — from what I've seen so far most use cases don't come near 65535 meters.

Let's keep this open — there's a chance we could add support for higher values while not sacrificing memory requirements, e.g. by introducing a multiplier spec property. That way you could control the height range at the expense of precision (e.g. have fill-extrusion-multiplier: 10 would allow going up to 655km but with 10m increments instead of 1m).

This use case seems quite common — every extrusion-based visualization that's on a bigger scale than city level (e.g. counties, countries) will need bigger values supported.

Just adding that I'm making an earthquake map that would benefit from world-scale extrusions (65535 isn't enough), so the use case is fairly broad:

screen shot 2017-04-27 at 2 08 42 pm

May be worth revisiting adding pixel-unit support for extrusions, per https://github.com/mapbox/mapbox-gl-js/issues/3385

Is this closed? I'm still getting an error when the extrusion height exceeds 65535 in v0.40.0.

Error: layers.base-bar.paint.fill-extrusion-height.stops[1][1]: 67000 is greater than the maximum value 65535
    at Function.module.exports.emitErrors (validate_style.js:10)
    at e.i._validate (style_layer.js:374)
    at e.i.setPaintProperty (style_layer.js:159)
    at t.setPaintProperty (style.js:756)
    at e.setPaintProperty (map.js:1309)

Whoops, I forgot to remove the maximum from the style specification. Fix in https://github.com/mapbox/mapbox-gl-js/pull/5320.

@jfirebaugh I believe the maximum of fill-extrusion-base also needs to be removed.

@yonghah Good catch, thank you! Removing in #5338.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

PBrockmann picture PBrockmann  Â·  3Comments

rasagy picture rasagy  Â·  3Comments

jfirebaugh picture jfirebaugh  Â·  3Comments

foundryspatial-duncan picture foundryspatial-duncan  Â·  3Comments

mollymerp picture mollymerp  Â·  3Comments