[QGIS-Developer] Default QgsFeatureFid ?
Sandro Santilli
strk at kbt.io
Fri Oct 15 12:07:35 PDT 2021
On Fri, Oct 15, 2021 at 01:41:59PM -0400, Greg Troxel wrote:
>
> Sandro Santilli <strk at kbt.io> writes:
>
> > On Fri, Oct 15, 2021 at 08:12:07AM -0400, Greg Troxel wrote:
> >
> >> There's a larger question lurking behind that, which is something about
> >> if tables in SQL can have NULL values and how that NULL is mapped into
> >> qgis's main internal representation and then back out to various
> >> formats. (I know there's a great CJ Date rant about NULL not belonging
> >> in SQL and how it is a symptom of denormalized data, but it is how it is
> >> these days.)
> >
> > I don't think QGIS needs to support "null" values for feature id.
> > Features *need* to have an not-null identifier.
>
> Sounds perfectly reasonable, but in that case I would expect that it is
> a non-optional argument to a constructor, and there should not be a way
> to have a default value.
The need inside QGIS is for an "unknown"/"not used"/"don't care"
situation, which is what I found in a class. There is probably
an "optional" kind of support in C++-11 but I'm not sure it's worth
the cost of adding an additional member to a class just to mean
the optionality since we can already express it with the existing FID_NULL
--strk;
More information about the QGIS-Developer
mailing list