[QGIS-Developer] Default QgsFeatureFid ?

Alessandro Pasotti apasotti at gmail.com
Fri Oct 15 03:03:40 PDT 2021


IMO the default value should be FID_NULL, IIRC 0 is a valid fid for some
providers.

On Fri, Oct 15, 2021 at 11:50 AM Sandro Santilli <strk at kbt.io> wrote:

> On Fri, Oct 15, 2021 at 10:45:52AM +0200, Alessandro Pasotti wrote:
> > Hi,
> >
> > maybe you can use
> >
> > #define FID_NULL            std::numeric_limits<QgsFeatureId>::min()
>
> Maybe, but the question is more generic: *should* a QgsFeatureId have
> a default value ? In that case maybe we could change its definition
> from a typedef to a class and define such default value ? OR keep
> it a typedef and consider 0 (the current typedefe'd type default)
> as meaning NULL (can we ensure no *real* feature would ever have a
> fid value of 0, from every provider?).
>
> --strk;
>
>

-- 
Alessandro Pasotti
QCooperative:  www.qcooperative.net
ItOpen:   www.itopen.it
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20211015/d775d305/attachment.html>


More information about the QGIS-Developer mailing list