Skip to main content
deleted 1926 characters in body
Source Link

Related to the question Creating bar chart from point layer using QGIS Geometry Generator, I am using with success the expressionexpressions proposed by user Taras (https://gis.stackexchange.com/users/99589/tarasTaras) in Solution 2: and for user Babel.

make_line(
    geometry_n(
            order_parts(
                nodes_to_points(
                    densify_by_count(
                        make_line(
                            make_point(
                                    x_min(layer_property(@layer, 'extent')),
                                    y_min(layer_property(@layer, 'extent'))
                                    ),
                            make_point(
                                    x_max(layer_property(@layer, 'extent')),
                                    y_min(layer_property(@layer, 'extent'))
                                    )
                            )
                        ,
                        (layer_property(@layer, 'feature_count') - 2)
                        )
                    ),
                orderby:="month"
                ),
            array_find(array_agg($id, order_by:="month"), $id) + 1),
    project(
        geometry_n(
            order_parts(
                nodes_to_points(
                    densify_by_count(
                        make_line(
                            make_point(
                                    x_min(layer_property(@layer, 'extent')),
                                    y_min(layer_property(@layer, 'extent'))
                                    ),
                            make_point(
                                    x_max(layer_property(@layer, 'extent')),
                                    y_min(layer_property(@layer, 'extent'))
                                    )
                            )
                        ,
                        (layer_property(@layer, 'feature_count') - 2)
                        )
                    ),
                orderby:="month"
                ),
            array_find(array_agg($id, order_by:="month"), $id) + 1),
        "temp",
        0
        )
    )

The two proposed solutions are working well, but I am confronted the same problem in both solutions.

However, if I scrollpan the map up (or any other direction) and hide some points (outside the map view extent), the graph is incomplete (some bars disappear):

I understand the cause of this effect, but is there a solution to prevent this? In other words, is it possible that the result of the Geometry Generator expression is kept in the view even if its original point object is outside the view extent?

Related to the question Creating bar chart from point layer using QGIS Geometry Generator, I am using the expression proposed by user Taras (https://gis.stackexchange.com/users/99589/taras) in Solution 2:

make_line(
    geometry_n(
            order_parts(
                nodes_to_points(
                    densify_by_count(
                        make_line(
                            make_point(
                                    x_min(layer_property(@layer, 'extent')),
                                    y_min(layer_property(@layer, 'extent'))
                                    ),
                            make_point(
                                    x_max(layer_property(@layer, 'extent')),
                                    y_min(layer_property(@layer, 'extent'))
                                    )
                            )
                        ,
                        (layer_property(@layer, 'feature_count') - 2)
                        )
                    ),
                orderby:="month"
                ),
            array_find(array_agg($id, order_by:="month"), $id) + 1),
    project(
        geometry_n(
            order_parts(
                nodes_to_points(
                    densify_by_count(
                        make_line(
                            make_point(
                                    x_min(layer_property(@layer, 'extent')),
                                    y_min(layer_property(@layer, 'extent'))
                                    ),
                            make_point(
                                    x_max(layer_property(@layer, 'extent')),
                                    y_min(layer_property(@layer, 'extent'))
                                    )
                            )
                        ,
                        (layer_property(@layer, 'feature_count') - 2)
                        )
                    ),
                orderby:="month"
                ),
            array_find(array_agg($id, order_by:="month"), $id) + 1),
        "temp",
        0
        )
    )

However, if I scroll the map up and hide some points (outside the map view extent), the graph is incomplete (some bars disappear):

I understand the cause of this effect, but is there a solution to prevent this? In other words, that the result of the Geometry Generator expression is kept in the view even if its original point object is outside the view extent?

Related to the question Creating bar chart from point layer using QGIS Geometry Generator, I am using with success the expressions proposed by user Taras in Solution 2 and for user Babel.

The two proposed solutions are working well, but I am confronted the same problem in both solutions.

However, if I pan the map up (or any other direction) and hide some points (outside the map view extent), the graph is incomplete (some bars disappear):

I understand the cause of this effect, but is there a solution to prevent this? In other words, is it possible that the result of the Geometry Generator expression is kept in the view even if its original point object is outside the view extent?

Source Link

How to prevent hidden objects when move extend layer

Related to the question Creating bar chart from point layer using QGIS Geometry Generator, I am using the expression proposed by user Taras (https://gis.stackexchange.com/users/99589/taras) in Solution 2:

make_line(
    geometry_n(
            order_parts(
                nodes_to_points(
                    densify_by_count(
                        make_line(
                            make_point(
                                    x_min(layer_property(@layer, 'extent')),
                                    y_min(layer_property(@layer, 'extent'))
                                    ),
                            make_point(
                                    x_max(layer_property(@layer, 'extent')),
                                    y_min(layer_property(@layer, 'extent'))
                                    )
                            )
                        ,
                        (layer_property(@layer, 'feature_count') - 2)
                        )
                    ),
                orderby:="month"
                ),
            array_find(array_agg($id, order_by:="month"), $id) + 1),
    project(
        geometry_n(
            order_parts(
                nodes_to_points(
                    densify_by_count(
                        make_line(
                            make_point(
                                    x_min(layer_property(@layer, 'extent')),
                                    y_min(layer_property(@layer, 'extent'))
                                    ),
                            make_point(
                                    x_max(layer_property(@layer, 'extent')),
                                    y_min(layer_property(@layer, 'extent'))
                                    )
                            )
                        ,
                        (layer_property(@layer, 'feature_count') - 2)
                        )
                    ),
                orderby:="month"
                ),
            array_find(array_agg($id, order_by:="month"), $id) + 1),
        "temp",
        0
        )
    )

I note that the display of objects depends on the objects within the extent of the view. Thus, to see the whole graph, all point objects must be in extent view. In this screenshot, all the points within the view extent are shown and therefore the whole graph is displayed:

enter image description here

However, if I scroll the map up and hide some points (outside the map view extent), the graph is incomplete (some bars disappear):

enter image description here

I understand the cause of this effect, but is there a solution to prevent this? In other words, that the result of the Geometry Generator expression is kept in the view even if its original point object is outside the view extent?