[Qgis-developer] QgsField::length semantic

Paolo Cavallini cavallini at faunalia.it
Tue Oct 11 01:47:50 PDT 2016


Il 11 ottobre 2016 10:45:18 CEST, Sandro Santilli <strk at kbt.io> ha scritto:
>Chasing a regression bug upon importing shapefile to postgresql [1]
>I've stumbled upon an unclear semantic of the "length" member of
>QgsField class [2].
>
>The Ogr provider, upon loading shapefiles, uses the DBF field width
>_minus_one_, for reasons that are unknown to me. Upon writing a layer
>to PostgreSQL, the missing _one_ results in values being too large
>for the field size.
>
>So the solution to this bug seems to be a clear definition of what
>QgsField::length is supposed to be, beacuse either Ogr provider is
>doing a mistake in reducing that field by 1 or PostgreSQL provider
>is doing a mistake in NOT augmenting that field by 1.
>
>Does anyone have an idea about how should QgsField::length be
>interpreted ?
>
>
>[1] http://hub.qgis.org/issues/15188
>[2]
>https://qgis.org/api/classQgsField.html#a8490cd90a5089a7f04bb97c725e54be9
>
>--strk; 
>
>  ()   Free GIS & Flash consultant/developer
>  /\   https://strk.kbt.io/services.html
>_______________________________________________
>Qgis-developer mailing list
>Qgis-developer at lists.osgeo.org
>List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

Isn't it related to the comma being counted in real fields?
All the best.
-- 
Sent from mobile. Sorry for being short
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20161011/6fbc3ac5/attachment.html>


More information about the Qgis-developer mailing list