qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.29k stars 2.96k forks source link

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

Closed qgib closed 3 years ago

qgib commented 6 years ago

Author Name: Richard Duivenvoorde (@rduivenvoorde) Original Redmine Issue: 17508 Affected QGIS version: 3.7(master) Redmine category:data_provider/ogr


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.


qgib commented 6 years ago

Author Name: Giovanni Manghi (@gioman)


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.


qgib commented 6 years ago

Author Name: Richard Duivenvoorde (@rduivenvoorde)


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)



qgib commented 6 years ago

Author Name: Giovanni Manghi (@gioman)


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!

qgib commented 6 years ago

Author Name: Richard Duivenvoorde (@rduivenvoorde)


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


qgib commented 6 years ago

Author Name: Giovanni Manghi (@gioman)


qgib commented 5 years ago

Author Name: Borys Jurgiel (@borysiasty)


Also when exporting Postgres (and probably any other) layer to GeoPackage, QGIS creates TEXT(255) 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.


qgib commented 5 years ago

Author Name: Giovanni Manghi (@gioman)


Borys Jurgiel wrote:

Also when exporting Postgres (and probably any other) layer to GeoPackage, QGIS creates TEXT(255) 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!


qgib commented 5 years ago

Author Name: Borys Jurgiel (@borysiasty)


qgib commented 5 years ago

Author Name: Borys Jurgiel (@borysiasty)


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

rouault commented 3 years ago

This issue has been fixed. There's no longer a 255 character limit