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

Error while trying to see the geometry changes of a feature #107

Open
SrNetoChan opened this issue Dec 4, 2023 · 4 comments
Open

Error while trying to see the geometry changes of a feature #107

SrNetoChan opened this issue Dec 4, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@SrNetoChan
Copy link
Contributor

SrNetoChan commented Dec 4, 2023

Describe the bug
I have a dataset which the identifier field is a text and called "identificador" (actually a uuid type, but when imported it becomes a text). When I try to see the diff viewer it returns a " key: identificador" error and the geometry tab for the particular changed features shows empty. Nevertheless, if I select the all layer,, the geometry diff show the changed features.

To Reproduce
Steps to reproduce the behavior:

  1. Create a postgis table like this:

CREATE TABLE public.concelho (
identificador uuid NOT NULL DEFAULT uuid_generate_v1mc(),
inicio_objeto timestamp NOT NULL,
fim_objeto timestamp NULL,
data_publicacao date NOT NULL,
dico varchar(255) NOT NULL,
nome varchar(255) NOT NULL,
geometria public.geometry(multipolygon, 3763) NOT NULL,
CONSTRAINT concelho_pkey PRIMARY KEY (identificador)
);

  1. Import it into a kart repository in a postgis working copy
  2. Open it in QGIS with kart plugin installed
  3. Do some changes and save
  4. Try to working copy changes

Expected behavior
feature geometries should show

Screenshots
feature diferences (not working)
imagem

layer diferences (working)
imagem

Version info (this is important!):
Kart Plugin version
1.0.13
QGIS version
3.28.12-Firenze
Operating system
Linux 6.5.6 76060506 generic x86_64 with glibc2.35
Kart version
Kart v0.14.2, Copyright (c) Kart Contributors
» GDAL v3.6.3; PROJ v9.2.0; PDAL v2.5.6
» PyGit2 v1.12.1; Libgit2 v1.6.4; Git v2.38.1; Git LFS v3.3.0
» SQLAlchemy v1.4.45; pysqlite3 v2.6.0/v3.40.1; SpatiaLite v5.0.1; Libpq v15.0.3

Additional context
Full Error

{
"ExceptionDetails": {
"Type": "KeyError",
"Message": "'identificador'"
},
"Environment": {
"Qgis Version": "3.28.12-Firenze",
"Operating System": "linux",
"Locale": "en"
},
"Trace": [
{
"Name": "treeItemChanged",
"Filename": "diffviewer.py",
"LineNo": 186,
"Variables": {
"self": "<kart.gui.diffviewer.DiffViewerWidget object at 0x7fe1312d5000>",
"current": "<kart.gui.diffviewer.FeatureItem object at 0x7fe13023e200>",
"previous": "None"
}
},
{
"Name": "_createLayers",
"Filename": "diffviewer.py",
"LineNo": 481,
"Variables": {
"self": "<kart.gui.diffviewer.DiffViewerWidget object at 0x7fe1312d5000>"
}
},
{
"Name": "_createFeatureDiffLayers",
"Filename": "diffviewer.py",
"LineNo": 528,

@SrNetoChan SrNetoChan added the bug Something isn't working label Dec 4, 2023
@SrNetoChan
Copy link
Contributor Author

Looking in more detail into the variables, it seems that oldlayer and newlayer are empty at this point.

@SrNetoChan
Copy link
Contributor Author

I think the problem may be from even sooner. I am not able to load layers from the kart plugin. It adds the layers, but the password is missing and QGIS cannot access to it. If I load it using normal qgis interface it works fine. I am creating my working copy using the following command:

kart init --workingcopy=postgresql://user:password@localhost:5432/mmsquare_aveiro/kart

I have then added it to kart plugin with add existing repository.

@olsen232
Copy link
Contributor

olsen232 commented Dec 4, 2023

Had a little look at this - @SrNetoChan's diagnosis seems correct, QGIS gets the location of the PostGIS table in the working copy okay, but doesn't get the password, so can't actually read, display, or edit the working copy table contents.
Assigned to @nyalldawson - happy to discuss further if required.

@SrNetoChan
Copy link
Contributor Author

I don't think it's related because I have tried other passwords but It also seems to struggle with passwords with strange characters. My password has a # character so, when creating the working copy I had to pass %23. This is not translated correctly on the plugin side and I am asked to correct my credentials.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants