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

[mvt] implement step expressions + improve conversion of sprites #58233

Merged
merged 11 commits into from
Aug 16, 2024

Conversation

3nids
Copy link
Member

@3nids 3nids commented Jul 24, 2024

this implements step expressions

it also fixes some cases where the sprite was not defined (mainly when data defined) + support step definition

see https://docs.mapbox.com/style-spec/reference/expressions/#step

fixes #57989

@3nids 3nids requested a review from nirvn July 24, 2024 13:22
@github-actions github-actions bot added this to the 3.40.0 milestone Jul 24, 2024
@qgis qgis deleted a comment from github-actions bot Jul 24, 2024
@3nids 3nids changed the title [mvt] improve conversion of sprites [mvt] implement step expressions + improve conversion of sprites Jul 24, 2024
@qgis qgis deleted a comment from github-actions bot Jul 24, 2024
@3nids 3nids closed this Jul 24, 2024
@3nids 3nids reopened this Jul 24, 2024
@qgis qgis deleted a comment from github-actions bot Jul 24, 2024
Copy link

github-actions bot commented Jul 24, 2024

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

(Built from commit 0f762cc)

3nids added 3 commits July 25, 2024 10:31
fixes some cases where the sprite was not defined (mainly when data defined) + support step definition
@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Aug 9, 2024
@github-actions github-actions bot removed the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Aug 13, 2024
@qgis qgis deleted a comment from github-actions bot Aug 13, 2024
@3nids
Copy link
Member Author

3nids commented Aug 14, 2024

This is ready to merge.

@3nids 3nids requested a review from nirvn August 15, 2024 19:12
Copy link
Contributor

@nirvn nirvn left a comment

Choose a reason for hiding this comment

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

@3nids , glad this is being addressed -- only one doc comment.

matchString.join( ',' ), valueString );
if ( matchString.count() == 1 )
{
caseString += QStringLiteral( "WHEN %1 IS %2 THEN %3 " ).arg( attribute, matchString.at( 0 ), valueString );
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the optimization.

/**
* Parses and converts a match function value list.
*
* \warning This is private API only, and may change in future QGIS versions
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we skip \since when it's a private API even though it's exposed to python?

@3nids 3nids merged commit 9d87ecf into qgis:master Aug 16, 2024
23 of 24 checks passed
@3nids 3nids deleted the mvt-sprites branch August 16, 2024 06:59
@qgis-bot
Copy link
Collaborator

The backport to release-3_38 failed:

The process '/usr/bin/git' failed with exit code 1
stderr
error: could not apply b66953a0c1a... handle zoom in parse expression
hint: After resolving the conflicts, mark them with
hint: "git add/rm <pathspec>", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".
hint: Disable this message with "git config advice.mergeConflict false"

stdout
Auto-merging src/core/vectortile/qgsmapboxglstyleconverter.cpp
Auto-merging src/core/vectortile/qgsmapboxglstyleconverter.h
Auto-merging tests/src/python/test_qgsmapboxglconverter.py
[backport-58233-to-release-3_38 832d1037ebc] [mvt] improve conversion of sprites
 Author: Denis Rouzaud <denis.rouzaud@gmail.com>
 Date: Wed Jul 24 12:04:23 2024 +0200
 7 files changed, 198 insertions(+), 44 deletions(-)
 create mode 100644 tests/testdata/vector_tile/sprites/swisstopo-sprite@2x.json
 create mode 100644 tests/testdata/vector_tile/sprites/swisstopo-sprite@2x.png
Auto-merging src/core/vectortile/qgsmapboxglstyleconverter.cpp
Auto-merging src/core/vectortile/qgsmapboxglstyleconverter.h
Auto-merging tests/src/python/test_qgsmapboxglconverter.py
[backport-58233-to-release-3_38 506cdb8b6ad] implement step expressions
 Author: Denis Rouzaud <denis.rouzaud@gmail.com>
 Date: Wed Jul 24 18:33:11 2024 +0200
 5 files changed, 129 insertions(+), 11 deletions(-)
Auto-merging src/core/vectortile/qgsmapboxglstyleconverter.cpp
Auto-merging tests/src/python/test_qgsmapboxglconverter.py
[backport-58233-to-release-3_38 6cec5d3eaae] fix some tests
 Author: Denis Rouzaud <denis.rouzaud@gmail.com>
 Date: Wed Jul 24 20:43:13 2024 +0200
 2 files changed, 16 insertions(+), 13 deletions(-)
Auto-merging src/core/vectortile/qgsmapboxglstyleconverter.cpp
CONFLICT (content): Merge conflict in src/core/vectortile/qgsmapboxglstyleconverter.cpp

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release-3_38 release-3_38
# Navigate to the new working tree
cd .worktrees/backport-release-3_38
# Create a new branch
git switch --create backport-58233-to-release-3_38
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick 0d33487affed2fb952c6ab88bf5bb8b53a1e99cc,9ddd2de832668a5a5e25719bcc70f07f0b1da507,6713b22a9655a73aa32821a2e4513dc1fbccefb7,b66953a0c1aeeab1eaf356a90c4ade8c29f6547e,79e3e48fb9da15d3c251c82b3394d191030b0aca,c93463f91287cea501a3c4f27fbb4abdb6e44e09,3931301c4a87aac5f08579458e7be9a4391ef789,b602cb70fe58f9525539abc37fecbb7a9be0cdae,0fd10899de123717bce75017e8bf3db761d80ee1,165672d823ad52c3c28964a7e9eeb30b2e786f5a,0f762cce15a552ead94ee3ddddcceb54c114daf2
# Push it to GitHub
git push --set-upstream origin backport-58233-to-release-3_38
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release-3_38

Then, create a pull request where the base branch is release-3_38 and the compare/head branch is backport-58233-to-release-3_38.

@qgis-bot qgis-bot added the failed backport The automated backport attempt failed, needs a manual backport label Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
failed backport The automated backport attempt failed, needs a manual backport Vector tiles
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mapbox GL style converter skips step expressions
4 participants