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

[processing] Brand new generate elevation profile image algorithm #59061

Merged
merged 4 commits into from
Nov 10, 2024

Conversation

nirvn
Copy link
Contributor

@nirvn nirvn commented Oct 13, 2024

Description

This PR adds a brand new generate elevation profile image algorithm to the processing toolbox:

Screenshot From 2024-10-13 17-16-57

This can come in super handy as part of models that need to output elevation profiles for multiple curves.

I've tried to find a balance in picking the parameters exposed here. There would be plenty more to do, but unsure how much further we should go :)

By default, the algorithm will set the elevation profile plot's distance (X axis) and elevation (Y axis)'s minimum and maximum to match the curve length and Z range of the rendered layers. Users can manually overwrite these set via advanced parameters:

image

@nirvn nirvn added the Frozen Feature freeze - Do not merge! label Oct 13, 2024
@github-actions github-actions bot added this to the 3.40.0 milestone Oct 13, 2024
@nirvn nirvn added the Requires Tests! Waiting on the submitter to add unit tests before eligible for merging label Oct 13, 2024
@nirvn nirvn force-pushed the processing_elevation_profile branch from 6d23f91 to 73a935e Compare October 13, 2024 10:27
Copy link

github-actions bot commented Oct 13, 2024

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit a23d131)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit a23d131)

@nirvn nirvn force-pushed the processing_elevation_profile branch 2 times, most recently from 5762249 to 81ca4f7 Compare October 30, 2024 04:41
dpiParam->setFlags( dpiParam->flags() | Qgis::ProcessingParameterFlag::Advanced );
addParameter( dpiParam.release() );

addParameter( new QgsProcessingParameterFileDestination( QStringLiteral( "OUTPUT" ), QObject::tr( "Output image" ) ) );
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should use the same logic as QgsLayoutToImageAlgorithm to set the file filters here

@nirvn nirvn force-pushed the processing_elevation_profile branch from 81ca4f7 to 524239d Compare November 9, 2024 08:49
@nirvn nirvn force-pushed the processing_elevation_profile branch from 524239d to 6ba10d4 Compare November 10, 2024 06:56
Copy link

Tests failed for Qt 5

One or more tests failed using the build from commit 6ba10d4

generate_elevation_profile (generateElevationProfileImage)

generate_elevation_profile

Test failed at generateElevationProfileImage at tests/src/analysis/testqgsprocessingalgspt2.cpp:1992

Rendered image did not match tests/testdata/control_images/processing_algorithm/expected_generate_elevation_profile/expected_generate_elevation_profile.png (found 21082 pixels different)

The full test report (included comparison of rendered vs expected images) can be found here.

Further documentation on the QGIS test infrastructure can be found in the Developer's Guide.

Copy link

Tests failed for Qt 6

One or more tests failed using the build from commit 6ba10d4

generate_elevation_profile (generateElevationProfileImage)

generate_elevation_profile

Test failed at generateElevationProfileImage at tests/src/analysis/testqgsprocessingalgspt2.cpp:1992

Rendered image did not match tests/testdata/control_images/processing_algorithm/expected_generate_elevation_profile/expected_generate_elevation_profile.png (found 28482 pixels different)

The full test report (included comparison of rendered vs expected images) can be found here.

Further documentation on the QGIS test infrastructure can be found in the Developer's Guide.

@nirvn nirvn force-pushed the processing_elevation_profile branch from 6ba10d4 to a23d131 Compare November 10, 2024 09:15
@nirvn nirvn merged commit af337d0 into qgis:master Nov 10, 2024
29 checks passed
@DelazJ DelazJ added Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo. Changelog Items that are queued to appear in the visual changelog - remove after harvesting labels Nov 11, 2024
@qgis-bot
Copy link
Collaborator

@nirvn

This pull request has been tagged for the changelog.

  • The description will be harvested so please provide a "nearly-ready" text for the final changelog
  • If possible, add a nice illustration of the feature. Only the first one in the description will be harvested (GIF accepted as well)
  • If you can, it's better to give credits to your sponsor, see below for different formats.

You can edit the description.

Format available for credits
  • Funded by NAME
  • Funded by URL
  • Funded by NAME URL
  • Sponsored by NAME
  • Sponsored by URL
  • Sponsored by NAME URL

Thank you!

@qgis-bot
Copy link
Collaborator

@nirvn
This pull request has been tagged as requiring documentation.

A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged.

Please update the description (not the comments) with helpful description and screenshot to help the work from documentors.
Also, any commit having [needs-doc] or [Needs Documentation] in will see its message pushed to the issue, so please be as verbose as you can.

Thank you!

@qgis-bot
Copy link
Collaborator

@nirvn
A documentation ticket has been opened at qgis/QGIS-Documentation#9379
It is your responsibility to visit this ticket and add as much detail as possible for the documentation team to correctly document this change.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog Items that are queued to appear in the visual changelog - remove after harvesting Frozen Feature freeze - Do not merge! Needs Documentation When merging a labeled PR, an issue will be created in the Doc repo. Requires Tests! Waiting on the submitter to add unit tests before eligible for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants