Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add raster-dem encoding parameters to RasterDEMSourceSpecification #337

Merged
merged 8 commits into from
Sep 26, 2023

Conversation

ibesora
Copy link
Collaborator

@ibesora ibesora commented Sep 16, 2023

Following #326 this PR adds redMix, blueMix, greenMix and baseMix parameters to RasterDEMSourceSpecification

See this PR on the maplibre-gl-js repo for the other part of the implementation

Launch Checklist

  • Confirm your changes do not include backports from Mapbox projects (unless with compliant license) - if you are not sure about this, please ask!
  • Briefly describe the changes in this PR.
  • Link to related issues.
  • Include before/after visuals or gifs if this PR includes visual changes.
  • Write tests for all new functionality.
  • Document any changes to public APIs.
  • Post benchmark scores.
  • Add an entry to CHANGELOG.md under the ## main section.

@codecov-commenter
Copy link

codecov-commenter commented Sep 16, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (ab0553c) 77.82% compared to head (5e29d3a) 77.99%.
Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #337      +/-   ##
==========================================
+ Coverage   77.82%   77.99%   +0.17%     
==========================================
  Files         100      101       +1     
  Lines        4108     4140      +32     
  Branches     1176     1183       +7     
==========================================
+ Hits         3197     3229      +32     
  Misses        911      911              
Files Coverage Δ
src/validate/validate_raster_dem_source.ts 100.00% <100.00%> (ø)
src/validate/validate_source.ts 80.39% <100.00%> (+1.22%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ibesora ibesora changed the title Ib/external raster dem encoding Add raster-dem encoding parameters to RasterDEMSourceSpecification Sep 16, 2023
@ibesora ibesora marked this pull request as ready for review September 16, 2023 16:05
@HarelM
Copy link
Collaborator

HarelM commented Sep 16, 2023

I'm not sure the word mix is the right word here.
I would consider redMultiplier or redFactor as better describing the expected definition.
For the base I would consider baseShift maybe.

@HarelM
Copy link
Collaborator

HarelM commented Sep 16, 2023

Do we want to add specific valuations (and tests) for when setting the new value with mapbox ro terrain encoding? Are there any other tests that needs to be added?

@ibesora
Copy link
Collaborator Author

ibesora commented Sep 18, 2023

I would consider redMultiplier or redFactor as better describing the expected definition.
For the base I would consider baseShift maybe.

Changed them to redFactor, greenFactor, blueFactor, and baseShift

Do we want to add specific valuations (and tests) for when setting the new value with mapbox ro terrain encoding? Are there any other tests that needs to be added?

Added an error raised when "custom" encoding is set and you the style also sets any of the encoding parameters

src/validate/validate.ts Outdated Show resolved Hide resolved
@HarelM
Copy link
Collaborator

HarelM commented Sep 18, 2023

I've added a few nit picks, looks good otherwise! THANKS!

@wipfli
Copy link
Contributor

wipfli commented Sep 18, 2023

How did you decided that it should be redFactor and not red-factor or red_factor? Skimming over the json file, it looks like all 3 conventions can be found...

@ibesora
Copy link
Collaborator Author

ibesora commented Sep 18, 2023

I've added a few nit picks, looks good otherwise! THANKS!

Updated, thanks for reviewing!

How did you decided that it should be redFactor and not red-factor or red_factor? Skimming over the json file, it looks like all 3 conventions can be found...

This was not clear to me. I did look at how the other properties of sources were called and everything, except minzoom and maxzoom (🤷) , seemed to use camelcase (tileSize, promoteId, clusterRadius, clusterMaxZoom, ...)

@HarelM
Copy link
Collaborator

HarelM commented Sep 19, 2023

Can you check that the coverage for the newly added file is 100%?
For some reason, the codecov is not getting updated with latest run information, I'll need to check what went wrong, but until then let's do it manually...
Other than the last comment, this PR is good to go from my point of view.

@ibesora
Copy link
Collaborator Author

ibesora commented Sep 26, 2023

Can you check that the coverage for the newly added file is 100%? For some reason, the codecov is not getting updated with latest run information, I'll need to check what went wrong, but until then let's do it manually... Other than the last comment, this PR is good to go from my point of view.

I removed what you pointed out in your last comment and checked that the coverage didn't go down with the added file.
Update: Running codecov locally showed that three lines were not being checked, I added a couple additional tests to get to 100.

I think this should be ready to go now? How does the process follow? Should we wait until a new package version is published to get it working on the maplibre-gl-js side?

@HarelM
Copy link
Collaborator

HarelM commented Sep 26, 2023

Yes, after meeting this there's a need to crave a release and then use it in gl js.
The best approach would be for your to create the version bump PR here so that I can review it and publish a new version.

@HarelM HarelM merged commit 58eb347 into maplibre:main Sep 26, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants