Bug report #17508

SaveAs Geopackage: TEXT fields are converted to TEXT(255)

Added by Richard Duivenvoorde over 6 years ago. Updated about 5 years ago.

Status:Open
Priority:Normal
Assignee:-
Category:Data Provider/OGR
Affected QGIS version:3.7(master) Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:25405

Description

Connecting to a WFS like:
http://geozet.koop.overheid.nl/wfs?version=1.0.0&request=GetCapabilities
then >70000 features layer: geozet:bekendmakingen_punt

That data has one attribute 'beschrijving' (description) which as about 350 chars.
So when you save as GeoPackage you cannot set a size, so QGIS tells you:

Warning 1: Value of field 'beschrijving' has 274 characters, whereas maximum allowed is 255.
Warning 1: Value of field 'beschrijving' has 288 characters, whereas maximum allowed is 255.
Warning 1: Value of field 'beschrijving' has 284 characters, whereas maximum allowed is 255.
Warning 1: Value of field 'beschrijving' has 629 characters, whereas maximum allowed is 255.
Warning 1: Value of field 'titel' has 264 characters, whereas maximum allowed is 255.
Warning 1: Value of field 'beschrijving' has 264 characters, whereas maximum allowed is 255.
More than 1000 errors or warnings have been reported. No more will be reported from now.
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

1Eh7xisXno (196 KB) Richard Duivenvoorde, 2017-11-21 04:40 PM

History

#1 Updated by Giovanni Manghi over 6 years ago

  • Status changed from Open to Feedback

Hi Richard, just tried on master and had no issues, ex:

Omgevingsvergunning Op adres vindt u een korte omschrijving van de activiteit(en) en het interne nummer. Rijssen Middeldijk (M 537), 7462PD, kappen bomen, 170846 (16-10-17), 5+12* Toelichting Alle plannen, (ontwerp)besluiten, vergunningen en meldingen kunt u tijdens kantooruren inzien in het gemeentehuis bij het loket Ruimtelijk Domein. Daar kunt u ook terecht voor meer informatie. De medewerkers van dit loket zijn telefonisch bereikbaar op (0548) 854 837. 5 Verleende vergunning (regulier) Deze omgevingsvergunning is verleend. Tussen haakjes leest u de verzenddatum van het besluit. Zie voor meer informatie over bezwaarmogelijkheden punt 12. 12 Bezwaar Binnen 6 weken na de verzenddatum van het besluit kunnen belanghebbenden een bezwaarschrift indienen bij het college van burgemeester en wethouders van Rijssen-Holten. Voor verkeersbesluiten geldt dat belanghebbenden binnen 6 weken na de bekendmaking in de Staatscourant bezwaar kunnen maken. Tijdens de bezwaarprocedure geldt het genomen besluit. Dit geldt niet voor besluiten voorzien van een *. Die besluiten treden pas in werking nadat de bezwarentermijn verstreken is of, als binnen die termijn een verzoek om voorlopige voorziening is ingediend, op dat verzoek is beslist. Hebt u een spoedeisend belang bij schorsing van het besluit? Dan kunt u naast het bezwaarschrift een verzoek om voorlopige voorziening indienen bij de Voorzieningenrechter van de rechtbank Overijssel, afdeling Bestuursrecht, Postbus 10067, 8000 GB Zwolle. Meer informatie over bezwaar vindt u op www.rijssen-holten.nl/bezwaar. Een geprinte versie is verkrijgbaar bij het loket Ruimtelijk Domein.

#2 Updated by Richard Duivenvoorde over 6 years ago

  • File 1Eh7xisXno added
  • Category changed from Data Provider to Data Provider/OGR

Hi Giovanni, you are right. I did not even look INTO the gpkg :-(

But what are these 'warning's then?
Grepping on "Value of field" does not show anything too in QGIS sources.
So it is probably a GDAL message?

When I look into the QGIS properties of the original WFS layer, it does not have a max length for it's attributes.
If I save it as gpkg, QGIS shows me that the length = 255chars for the text fields.
(see screenshot)

#3 Updated by Giovanni Manghi over 6 years ago

Richard Duivenvoorde wrote:

Hi Giovanni, you are right. I did not even look INTO the gpkg :-(

But what are these 'warning's then?
Grepping on "Value of field" does not show anything too in QGIS sources.
So it is probably a GDAL message?

When I look into the QGIS properties of the original WFS layer, it does not have a max length for it's attributes.
If I save it as gpkg, QGIS shows me that the length = 255chars for the text fields.
(see screenshot)

Hi Richard,
in my case I didn't get the warnings. Cheers!

#4 Updated by Richard Duivenvoorde over 6 years ago

  • Status changed from Feedback to Closed

Ok, let's close it then, as it is working for QGIS, and apparently not a QGIS problem.

#5 Updated by Giovanni Manghi over 6 years ago

  • Resolution set to not reproducable

#6 Updated by Borys Jurgiel about 5 years ago

  • Subject changed from SaveAs Geopackage: >255 chars for txt field not allowed? to SaveAs Geopackage: TEXT fields are converted to TEXT(255)
  • Status changed from Closed to Reopened
  • Resolution deleted (not reproducable)

Also when exporting Postgres (and probably any other) layer to GeoPackage, QGIS creates TEXT fields even if the source field had unlimited length.

Longer strings ARE saved during export, however they are not editable, as QGIS won't allow to save them back.

#7 Updated by Giovanni Manghi about 5 years ago

  • Status changed from Reopened to Open

Borys Jurgiel wrote:

Also when exporting Postgres (and probably any other) layer to GeoPackage, QGIS creates TEXT fields even if the source field had unlimited length.

Longer strings ARE saved during export, however they are not editable, as QGIS won't allow to save them back.

Hi Borys, can you please set the new affected version? thanks!

#8 Updated by Borys Jurgiel about 5 years ago

  • Affected QGIS version changed from master to 3.7(master)

#9 Updated by Borys Jurgiel about 5 years ago

See also the PRECISION lco: https://www.gdal.org/drv_geopackage.html

Also available in: Atom PDF