Parcel calculation #49
Labels
No Label
backlog
bug
duplicate
enhancement
feature
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
in discussion
invalid
priority
1
priority
2
priority
3
priority
4
priority
5
question
wontfix
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: IT-Naturschutz/konova#49
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Status quo
There is no parcel calculation so far (Flurstücksberechnung).
Feature
A new geometry (does not matter for which object) should be intersected with some WFS to generate information about underlying parcels, administrative regions and so on.
Storage
There are two possible ways to store this data.
SQL database
Parcel
which holds the 'Flurstück', 'Flurstückzähler, 'Gemarkung', 'Landkreis', and so on.Parcel
andGeometry
models. This way we can reach all related parcels of a geometry and for each parcel which geometries are overlaying in there.updated_on
timestamp toParcel
, which can be used to keep track on the age of a calculated information and display it in the frontend for users as well.Update parcels
or similar, to manually rerun the parcel calculation. This would be a typical 'force' action, not running on a constant time interval.No SQL database
Geometry
id as key and a json string as value, storing the results of the last parcel calculation.Conclusion
The sql approach would benefit more, since we can easily use the stored sql data as filter e.g. on the overview filter sections for interventions, compensations and so on. This way of filtering would not be possible (in a decent performance) running on redis json strings.
Calculation
For calculating proper WFS will be used. I just asked for e.g. existing internal WFS which can be used and directly deliver all the needed data at once. Otherwise we would need to run intersections on multiple WFS which leads to more traffic on the network as well as slower performance.
Parcel and District
To avoid redundant data inside of the above described
Parcel
model, we introduce another model calledDistrict
District
Holds data on 'Kreis', 'Verbandsgemeinde' and 'Gemeinde' as well as a M2M relation to
Geometry
. This way we reduce the amount of data stored inParcel
:A geometry can have a relation to a hundred parcel entries but all parcels are located in the same district. Therefore each parcel entry does not need to hold the data on the above named fields again and again but instead holds a foreign key on a
District
entry.Finished parcels
Parcels are now being updated each time the general form of a dataset (intervention, compensation, eco-account or ema) is submitted.
Parcel update command
Using
update_all_parcels
all non-empty geometries from the database will be processed and all parcels will be recalculated.Example
This command can be used e.g. with cronjob for force-updating all parcels once a month.
Update runtime
Due to the network limitations of the official WFS based approach, another issue has been opened to enhance the UX: #55
Merged in #56