Geographic Information Systems Asked by Andrey Sirbu on June 24, 2021
There are two layers: Parcels and Parking.
In parking has attribute: parcels_objects
, this is lists of parcels intersect of parking.
When I create a parking object, I want to calculate all parcels containing parking lots and write a list of their numbers to the parcels_objects
parking field attribute.
To do this, in the attribute forms for the parcels_objects
field, I created an aggregate expression in default value:
aggregate(
layer:='Parcels',
aggregate:='concatenate',
expression:="parcel_number",
concatenator:=', ',
filter:=intersects($geometry,geometry(@parent))
)
This expression works, but it is very slow because (6 seconds before opening the attribute form) there are 50,000 objects in the parcel layer.
Spatial index was created in both tables:
CREATE INDEX parcels_sx ON public.parcels USING gist (geom);
CREATE INDEX parking_sx ON public.parking USING gist (geom);
Dividing workflows into 2 different ones will speed up the assignment of the parcels_objects attribute, for example:
But the idea is that the business process of entering information was continuous, for example:
The virtual field in my case is not entirely suitable, since I want to calculate the parcels_objects with each edit.
Form opening slowdown occurs when the option is checked: Apply default value on update:
How can you make this expression run faster?
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP