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

Use all nan values to represent a NULL QgsRectangle #54989

Closed
wants to merge 3 commits into from

Conversation

strk
Copy link
Contributor

@strk strk commented Oct 19, 2023

This was suggested by Benoit in
#54646 (comment)

It may make it easier to spot missing isNull() checks by callers.

I'm pretty sure things will fail but chances are that merging various commits currently in other PRs could show why they are needed.

See for instance GH-54976 and GH-54954

I'm marking this as an API break, correct me if I'm wrong

@strk strk added the API Break! Breaks stable API. Proceed with extreme caution!! label Oct 19, 2023
@github-actions github-actions bot added this to the 3.34.0 milestone Oct 19, 2023
@nyalldawson nyalldawson reopened this Oct 23, 2023
@strk strk removed the API Break! Breaks stable API. Proceed with extreme caution!! label Oct 23, 2023
@strk strk changed the title Use all nan values for default-constructed QgsRectangle Use all nan values to represent a NULL QgsRectangle Oct 23, 2023
@strk strk force-pushed the rectangle-null-by-default branch from 393fbcf to 52765a3 Compare October 23, 2023 07:51
@strk
Copy link
Contributor Author

strk commented Oct 23, 2023

I've rebased to current master branch and also made ::setNull() use NaN to represent the null rectangle and ::isNull() only accepting that representation.

@strk
Copy link
Contributor Author

strk commented Oct 30, 2023

QGIS server seem to have a problem with nan values in rectangles:
https://github.com/qgis/QGIS/actions/runs/6610295956/job/17959138261#step:13:301

@strk strk force-pushed the rectangle-null-by-default branch from 5f6c92f to d17982e Compare October 31, 2023 13:25
@strk
Copy link
Contributor Author

strk commented Oct 31, 2023

The failure is due to QgsMapRendererJob::prepareJobs not checking to see if the visibleExtent is null or not. When it is null, it obviously fail to reproject.

I guess if the visible extent is null that method should just do nothing ?

\cc @elpaso

@strk
Copy link
Contributor Author

strk commented Oct 31, 2023

Beside, mSettings.visibleExtent() is called for every iteration but it doesn't need to ?

@strk
Copy link
Contributor Author

strk commented Oct 31, 2023

I think the problem is with the semantic of QgsRectangle::isFinite() that would always be false for null rectangles, making it kind of useless

@strk strk force-pushed the rectangle-null-by-default branch from 9f1e278 to df759e4 Compare October 31, 2023 17:45
Copy link

The QGIS project highly values your contribution and would love to see this work merged! Unfortunately this PR has not had any activity in the last 14 days and is being automatically marked as "stale". If you think this pull request should be merged, please check

  • that all unit tests are passing

  • that all comments by reviewers have been addressed

  • that there is enough information for reviewers, in particular

    • link to any issues which this pull request fixes

    • add a description of workflows which this pull request fixes

    • add screenshots if applicable

  • that you have written unit tests where possible
    In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this pull request.
    If there is no further activity on this pull request, it will be closed in a week.

@github-actions github-actions bot added the stale Uh oh! Seems this work is abandoned, and the PR is about to close. label Nov 15, 2023
Copy link

While we hate to see this happen, this PR has been automatically closed because it has not had any activity in the last 21 days. If this pull request should be reconsidered, please follow the guidelines in the previous comment and reopen this pull request. Or, if you have any further questions, just ask! We love to help, and if there's anything the QGIS project can do to help push this PR forward please let us know how we can assist.

@github-actions github-actions bot closed this Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Uh oh! Seems this work is abandoned, and the PR is about to close.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants