Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

[core] add support for mapzen terrarium - #11154

Merged
mollymerp merged 5 commits into
masterfrom
mapzen-terrarium
Feb 14, 2018
Merged

mollymerp merged 5 commits into
masterfrom
mapzen-terrarium

Conversation

@mollymerp

@mollymerp mollymerp commented Feb 8, 2018 •

Copy link
Copy Markdown
Contributor

port of mapbox/mapbox-gl-js#6110 adding support for mapzen terrarium encoded dem RGB tiles.

ended up #includeing Tileset all over the place because it seemed like the place we store top-level source keys like encoding, but not sure this is the best approach – happy to hear suggestions of alternatives.

closes #11204

@mollymerp mollymerp added GL JS parity For feature parity with Mapbox GL JS Core The cross-platform C++ core, aka mbgl labels Feb 8, 2018
@mollymerp
mollymerp requested a review from kkaefer February 8, 2018 22:22
Comment thread src/mbgl/geometry/dem_data.cpp Outdated
}

auto decodeRGB = [&] (const uint8_t r, const uint8_t g, const uint8_t b) {
if (encoding == Tileset::Encoding::Mapbox) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using an if, as it's called inside a loop, you could change that to a Functor so it gets inlined and resembles what you did in the js version, selecting the decode function before the loop.

Comment thread include/mbgl/util/tileset.hpp Outdated
Range<uint8_t> zoomRange;
std::string attribution;
Scheme scheme;
Encoding encoding;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tileset primarily mirrors TileJSON, so it would be helpful to add a comment here that encoding is not a part of the spec (as yet?).

Comment thread test/geometry/dem_data.test.cpp Outdated
@@ -16,28 +17,28 @@ auto fakeImage = [](Size s) {

TEST(DEMData, Constructor) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice to have tests for Terrarium data.

@kkaefer kkaefer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing tests

Comment thread include/mbgl/util/tileset.hpp Outdated
class Tileset {
public:
enum class Scheme : bool { XYZ, TMS };
enum class Encoding : bool { Mapbox, Terrarium };

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a more specific name, e.g. DEMEncoding?

@mollymerp
mollymerp force-pushed the mapzen-terrarium branch 2 times, most recently from ad41b04 to e7aa8e1 Compare February 14, 2018 01:57
Comment thread test/geometry/dem_data.test.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: duplicate expects for dim and border @

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Core The cross-platform C++ core, aka mbgl GL JS parity For feature parity with Mapbox GL JS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Mapzen terrain

4 participants