Discussion:
[Qgis-user] Provider Error
Martin Bittens
2018-07-13 12:25:38 UTC
Permalink
Hello QGIS Users.


I want to create a text field in an attribute table which contains some
data points by using the field calculator. So I selected:


- Create a new field

- Output field name: Comment

- Output field type: Text (string)

- Output field length: 10

- Text input: 'Area 2'


The Output preview shows: 'Area 2'. By clicking on "OK" I receive the
following message: "Could not add the new field to the provider"

My system is: Windows 10, QGIS2.18.21.

In the previous versions of QGIS I did not get that error when I added
with the field calculator text fields in attribute tables.

Does somebody know a solution solving the error?


Thank you very much.


Martin


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
Richard Duivenvoorde
2018-07-13 12:53:10 UTC
Permalink
Depending on the type of provider, you can or can not add fields.

Eg, if I'm correct a csv file will not work.

You can see in the properties of the layer what the 'capabilities' are
of a provider.
So to make this possible, you could first create a geopackage or
shapefile from it? And then back?

Regards,

Richard
Post by Martin Bittens
Hello QGIS Users.
I want to create a text field in an attribute table which contains some
- Create a new field
- Output field name: Comment
- Output field type: Text (string)
- Output field length: 10
- Text input: 'Area 2'
The Output preview shows: 'Area 2'. By clicking on "OK" I receive the
following message: "Could not add the new field to the provider"
My system is: Windows 10, QGIS2.18.21.
In the previous versions of QGIS I did not get that error when I added
with the field calculator text fields in attribute tables.
Does somebody know a solution solving the error?
Thank you very much.
Martin
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
_______________________________________________
Qgis-user mailing list
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Richard Duivenvoorde
2018-07-13 13:28:40 UTC
Permalink
Mmm, that should just work.

Is the shapefile maybe in a zip?
Is it read only on the file system?
If you save it as (another) shp file, does it behave the same?


Else: can you sent me (a part of) the shp so I can test here?

Regards,

Richard Duivenvoorde
Hello Richard,
it is a shapefile I am working with.
Martin
Post by Richard Duivenvoorde
Depending on the type of provider, you can or can not add fields.
Eg, if I'm correct a csv file will not work.
You can see in the properties of the layer what the 'capabilities' are
of a provider.
So to make this possible, you could first create a geopackage or
shapefile from it? And then back?
Regards,
Richard
Post by Martin Bittens
Hello QGIS Users.
I want to create a text field in an attribute table which contains some
- Create a new field
- Output field name: Comment
- Output field type: Text (string)
- Output field length: 10
- Text input: 'Area 2'
The Output preview shows: 'Area 2'. By clicking on "OK" I receive the
following message: "Could not add the new field to the provider"
My system is: Windows 10, QGIS2.18.21.
In the previous versions of QGIS I did not get that error when I added
with the field calculator text fields in attribute tables.
Does somebody know a solution solving the error?
Thank you very much.
Martin
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
_______________________________________________
Qgis-user mailing list
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Richard Duivenvoorde
2018-07-13 14:39:42 UTC
Permalink
Hi Martin,

I can confirm your findings! Looks like a bug to me.

Are you able to create an issue for it on issues.qgis.org?
Else I will do it.

I'm going to compile Qgis 2.14 too, to see if it was already there...

Note that in QGIS3 it just works!

Regards,

Richard Duivenvoorde
Post by Martin Bittens
Hello QGIS Users.
I want to create a text field in an attribute table which contains some
- Create a new field
- Output field name: Comment
- Output field type: Text (string)
- Output field length: 10
- Text input: 'Area 2'
The Output preview shows: 'Area 2'. By clicking on "OK" I receive the
following message: "Could not add the new field to the provider"
My system is: Windows 10, QGIS2.18.21.
In the previous versions of QGIS I did not get that error when I added
with the field calculator text fields in attribute tables.
Does somebody know a solution solving the error?
Thank you very much.
Martin
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
_______________________________________________
Qgis-user mailing list
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
Richard Duivenvoorde
2018-07-13 15:13:14 UTC
Permalink
Post by Richard Duivenvoorde
I'm going to compile Qgis 2.14 too, to see if it was already there...
Note that in QGIS3 it just works
Mmm, QGIS 2.14 also just works...

Richard
Salvatore Larosa
2018-07-13 15:15:10 UTC
Permalink
Hi,
Post by Martin Bittens
Hello QGIS Users.
I want to create a text field in an attribute table which contains some
- Create a new field
- Output field name: Comment
- Output field type: Text (string)
- Output field length: 10
- Text input: 'Area 2'
The Output preview shows: 'Area 2'. By clicking on "OK" I receive the
following message: "Could not add the new field to the provider"
My system is: Windows 10, QGIS2.18.21.
In the previous versions of QGIS I did not get that error when I added
with the field calculator text fields in attribute tables.
Does somebody know a solution solving the error?
Thank you very much.
Martin
this is a known issue [0] and there already is a patch to fix it [1].

A workaround that you could adopt before the patch get merged is changing
the precision value from 3 to 0 for the text field being created.
To change the precision value you have to select the decimal type before in
order to enable the spinbox widget.

Best Regards.

[0] - https://issues.qgis.org/issues/19283
[1] - https://github.com/qgis/QGIS/pull/7375
Continue reading on narkive:
Loading...