Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order of ORDERED enums not considered in attribute forms #940

Open
webrian opened this issue Jun 25, 2024 · 6 comments
Open

Order of ORDERED enums not considered in attribute forms #940

webrian opened this issue Jun 25, 2024 · 6 comments

Comments

@webrian
Copy link
Contributor

webrian commented Jun 25, 2024

The order of an ORDERED enumeration is not considered by Model Baker.

A simple INTERLIS model with a ordered enumeration:

INTERLIS 2.3;

MODEL SimpleTable (de)
AT "mailto:[email protected]"
VERSION "2024-05-02"  =

  DOMAIN

    LKoord = COORD 2460000.000 .. 2870000.000 [INTERLIS.M], 1045000.000 .. 1310000.000 [INTERLIS.M] ,ROTATION 2 -> 1;

    SimpleArt = (
      ErsteArt,
      ZweiteArt,
      DritteArt,
      VierteArt,
      FuenfteArt,
      SechsteArt
    ) ORDERED;

  TOPIC SimpleTopic =

    CLASS Table =
      Anzahl : 1 .. 1000;
      Bezeichnung : MTEXT*64;
      Geometrie : MANDATORY SimpleTable.LKoord;
      Art : SimpleTable.SimpleArt;
    END Table;

  END SimpleTopic;

END SimpleTable.

This model is implemented in the (PG) database as follows:

image

The column itfcode represents the order as defined in the data model.

Creating the QGIS project with Model Baker the enum values are ordered in an alphabetical way:

Bildschirmfoto vom 2024-06-25 15-23-30_dialog

I think from a user's point of view it would be preferable if the order of the values corresponded to the data model.

See also the discussion in the INTERLIS forum: https://interlis.discourse.group/t/ordered-enumerations/175

@signedav
Copy link
Member

signedav commented Jun 26, 2024

Shouldn't the seq giving the order?

Anyway, I think this would require a QGIS change. Maybe this is something to consider qgis/QGIS#48191

Still Model Baker should then set the sorting to the seq (or itf_code)

@webrian
Copy link
Contributor Author

webrian commented Jun 26, 2024

Currently the seq column does not correspond to the itf_code. Not sure if this is on purpose or an issue with ili2db?

@signedav
Copy link
Member

Yes you are right. I have to clarify that.

@gacarrillor
Copy link
Collaborator

Shouldn't the seq giving the order?

Anyway, I think this would require a QGIS change. Maybe this is something to consider qgis/QGIS#48191

Still Model Baker should then set the sorting to the seq (or itf_code)

See claeis/ili2db#526 (comment)

@gacarrillor
Copy link
Collaborator

From the ili2db docs:

seq Definiert die Reihenfolge der Aufzählelemente.

@signedav
Copy link
Member

signedav commented Oct 8, 2024

Thanks for the clarification. I asked back if it's just not working or like that on purpose. Let's see. If qgis/QGIS#48191 will be implemented with an order-expression, MB is flexible on that anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants