1

I have a database containing correspondences between codes (e.g., A = 1 = 11 = H = M, etc.). I've made the first 100 rows of this data available for download.

BDD Extract

I would like a feature where, upon entering codes in my working layer, the system automatically matches them with the relevant fields when saved. For instance, if I input "A" in the "EUNIS" field, I want it to match with "CORINE" (=1), HIC (=11), "ZH" (=H), "EUNIS22" (=M), and so on, based on the contents of the "BDD" layer.

Since the database is large, I believe the most efficient way to handle this is through SQL layers, possibly using SpatialLite layers.

Currently, I can obtain results for exact matches. I used this trigger :

    CREATE TRIGGER update_corine1
AFTER UPDATE OF EUNIS_1 ON HABITAT_POLY
BEGIN
    UPDATE HABITAT_POLY
    SET CORINE_1 = (SELECT "EUNIS12-CORINE" FROM BDD_Extract WHERE "EUNIS(2012)" = new.EUNIS_1)
    WHERE EUNIS_1 = new.EUNIS_1;
END;

However, I'm unsure how to manage multiple matches. I prefer not to allow modifying the "CORINE" field manually. Instead, I want QGIS to suggest a list of codes for each instance with multiple matches. The user can then choose the appropriate code manually (e.g., if A1.11 matches with 11.1, 11.2, and 11.3, a list of these three results should be presented for the user to choose from).

I'm quite open to any solution, maybe SpatialLite isn't fit for this situation.

1

1 Answer 1

0

I post the link to my final solution, so I can resolve this issue : QGIS load dynamic dropdown list from the content of another field, using separator

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.