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

Array not supported in the attribute table editor #1028

Open
thomaspiller opened this issue Oct 21, 2024 · 1 comment
Open

Array not supported in the attribute table editor #1028

thomaspiller opened this issue Oct 21, 2024 · 1 comment

Comments

@thomaspiller
Copy link
Collaborator

The "center" column generated by the Draw Tool cannot be edited from the attribute table editor.
This is due to the format of the column in the database which is an array of float8.
Array type is not supported in the editor and should be implemented.

To reproduce, you must:

  1. create a new polygon layer with the Draw Tool
  2. add a new circle
  3. import this new layer into the MapX database
  4. open the attribute table editor
  5. try to change the value of the "center" column
@fxi
Copy link
Member

fxi commented Oct 21, 2024

It's a rare issue, but it should be addressed.

In my local database, I have found about 27 occurrences of an 'ARRAY' type in columns in uploaded PostGIS layers.

SELECT
    t.table_name,
    t.column_name,
    t.data_type,
    t.udt_name,
    s.id AS layer_name
FROM
    information_schema.columns t
JOIN
    mx_sources s
    ON t.table_name = s.id
WHERE
    t.udt_name LIKE '%_array%' -- Filter for array types
    OR t.data_type = 'ARRAY'   -- This checks for array types explicitly
ORDER BY
    t.table_name,
    t.column_name;

The proposed solution is to work upstream by checking each uploaded table and layer to see if any columns have been converted into PostgreSQL arrays. Then, we could write a post-process script to convert those columns into the JSONB type, which is supported by the table editor. Or just support the ARRAY type in the table editor. To be tested..

Another option would be to use a trigger on table creation, but that would affect all future tables, not only non-spatial mapx tables and PostGIS layers (mx_sources).

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

No branches or pull requests

2 participants