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

Do not exclude vector layers when estimating the extent of the project #919

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

suricactus
Copy link
Collaborator

The removed if condition somehow slipped in, I don't see why it was added in the first place. I guess it was part poor attempt to rewrite the original code from commit 1df4f4090d847e50422881aca1af2595eb2ddb09:

    # Only vector layers
    mapsettings.setLayers(
        [layers[key] for key in layers if type(layers[key]) == QgsVectorLayer]
    )

    extent = mapsettings.fullExtent()

However, it is not clear why the if condition has been inverted, neither why the if condition was needed in the first place. If one says it's to prevent the infinite extent of the XYZ layers, the current code already checks for that a few lines below:

            if layer_extent.isNull() or not layer_extent.isFinite():
                continue

In any case, this line is removed for good now.

The removed if condition somehow slipped in, I don't see why it was
added in the first place. I guess it was part poor attempt to rewrite
the original code from commit `1df4f4090d847e50422881aca1af2595eb2ddb09`:

```
    # Only vector layers
    mapsettings.setLayers(
        [layers[key] for key in layers if type(layers[key]) == QgsVectorLayer]
    )

    extent = mapsettings.fullExtent()
```

However, it is not clear why the if condition has been inverted, neither
why the if condition was needed in the first place. If one says it's to
prevent the infinite extent of the XYZ layers, the current code already
checks for that a few lines below:
```
            if layer_extent.isNull() or not layer_extent.isFinite():
                continue
```

In any case, this line is removed for good now.
@duke-nyuki
Copy link
Collaborator

Task linked: QF-3988 Failed to obtain project extent

@suricactus suricactus merged commit 2a88347 into master Mar 25, 2024
8 checks passed
@suricactus suricactus deleted the QF-3988-extent branch March 25, 2024 13:32
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.

3 participants