GDALVector::featureTemplate was exposed to R as a read-only field, containing a list object meant to be a template for a feature in the layer with field values initialized to NA. It turned out not to be very helpful for its intended purpose. It is redundant with simply reading a feature from the layer and examining its structure (with str()), or examining the structure of the feature class definition returned by the method getLayerDefn(). Also, the class method fetch() can be called with n = 0 to return a 0-row data frame that is fully typed.
The internal class method setFeatureTemplate_(), called in the constructor, assumed that the data frame returned by initDF_() was initialized to NA values. PR #516 changed the data frame creation to use Rcpp::no_init() for creation of the column vectors, for performance. This resulted in setFeatureTemplate_() causing "Conditional jump or move depends on uninitialised value(s)" reported by Valgrind.
Rather than fix setFeatureTemplate_() to handle the initialization, it is being removed instead, on the rationale that the featureTemplate field mainly adds clutter with minimal utility.
This PR also renames the method initDF_() to createDF_() to better reflect its purpose, and the fact that it no longer actually initializes (which is done in fetch(), now the only method that directly uses createDF_()).
GDALVector::featureTemplate
was exposed to R as a read-only field, containing a list object meant to be a template for a feature in the layer with field values initialized toNA
. It turned out not to be very helpful for its intended purpose. It is redundant with simply reading a feature from the layer and examining its structure (withstr()
), or examining the structure of the feature class definition returned by the methodgetLayerDefn()
. Also, the class methodfetch()
can be called withn = 0
to return a 0-row data frame that is fully typed.The internal class method
setFeatureTemplate_()
, called in the constructor, assumed that the data frame returned byinitDF_()
was initialized toNA
values. PR #516 changed the data frame creation to useRcpp::no_init()
for creation of the column vectors, for performance. This resulted insetFeatureTemplate_()
causing "Conditional jump or move depends on uninitialised value(s)" reported by Valgrind.Rather than fix
setFeatureTemplate_()
to handle the initialization, it is being removed instead, on the rationale that thefeatureTemplate
field mainly adds clutter with minimal utility.This PR also renames the method
initDF_()
tocreateDF_()
to better reflect its purpose, and the fact that it no longer actually initializes (which is done infetch()
, now the only method that directly usescreateDF_()
).