Hi,
This is in part because SQLite (what GeoPackage is built around) doesn't
do character limits on text fields. You can declare them, but SQLite
just ignores them.
That said, the GeoPackage format does allow for them:
"... The optional maxchar_count
defines the maximum number of characters in
the string. If not specified, the length is
unbounded. The count is provided for
informational purposes, and applications MAY
choose to truncate longer strings if encountered.
When present, it is best practice for applications
to adhere to the character count. Stored as
SQLite TEXT"
So I'd suggest that QGIS simply not declare text limits on string fields
by default for GeoPackage, and only declare them when they're explicitly
declared (i.e. in the original data format).
Cheers,
Jonathan
On 2019-03-31 15:30, Stefan Keller wrote:
Hi,
I could replicate this behavior (limiting string to 255) using QGIS 3
by exporting a layer to a GeoPackage.
My impression is, that GeoPackage data provider is replacing
String/QString field types which have length 0, by a default length of
255 chars (which is obviously wrong).
:Stefan
Am So., 31. März 2019 um 13:47 Uhr schrieb Anita Graser <[email protected]>:
On Sun, Mar 31, 2019 at 11:42 AM Anita Graser <[email protected]> wrote:
On Sat, Mar 30, 2019 at 10:11 PM Alessandro Pasotti <[email protected]> wrote:
On Sat, Mar 30, 2019, 21:55 Anita Graser <[email protected]> wrote:
- Option #2: QGIS shouldn't create GeoPackages that store long strings in field
defined as text(255)
I'll create a ticket for #2 then.
Here it is: https://issues.qgis.org/issues/21714
Regards,
Anita
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer