[QGIS-Developer] Default QgsFeatureFid ?

Alessandro Pasotti apasotti at gmail.com
Fri Oct 15 01:45:52 PDT 2021


Hi,

maybe you can use

#define FID_NULL            std::numeric_limits<QgsFeatureId>::min()



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

> While writing unit test for QgsFeatureRequest in core I found
> that the filterFid() method for the default-constructed
> QgsFeatureRequest returns -1 rather than what a default-constructed
> QgsFeatureId() would return (0)
>
> So I've been wondering: *should* a QgsFeatureFid have a default
> value of -1 instead ? More generically: does QGIS make any assumption
> about *which* special value of QgsFeatureFid means "no fid" ?
>
> If there's no such notion as an "unspecified FID" then I wonder
> why QgsFeatureRequest is taking the effort of specifying a default
> value of it different from the default, and if there's a good reason
> it should probably be documented there.
>
> --strk;
>
>   Libre GIS consultant/developer
>   https://strk.kbt.io/services.html
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
>


-- 
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/2070840e/attachment.html>


More information about the QGIS-Developer mailing list