opengisch / qfieldcloud

QFieldCloud allows seamless synchronization of your field data with your spatial infrastructure with change tracking, team management and online-offline work capabilities in QField.
https://qfield.cloud
MIT License
102 stars 44 forks source link

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

Closed suricactus closed 3 months ago

suricactus commented 3 months ago

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 commented 3 months ago

Task linked: QF-3988 Failed to obtain project extent