GDAL API provides only OGRLayer::SetIgnoredFields() for reasons given in RFC 29.
GDALVector::setSelectedFields() sets the fields to include. Other than the specified fields will be ignored. This mimics the behavior of the -select argument in the ogr2ogr command line utility.
$setSelectedFields(fields)
' Set which fields will be included when retrieving features from the layer.
' The fields argument is a character vector of field names. Passing an
' empty string ("") for fields will reset to no ignored fields.
' See the $setIgnoredFields() method above for more information. The data
' source must provide IgnoreFields capability in order to set selected
' fields. Note that geometry fields, if desired, must be specified when setting
' selected fields, either by including named geometry field(s) or the special
' field "OGR_GEOMETRY" in the fields argument.
' No return value, called for side effects.
This PR also adds GDALVector::getFieldNames(), a convenience method as alternative to the list structure returned by getLayerDefn().
$getFieldNames()
' Returns a character vector of the layer's field names.
GDAL API provides only
OGRLayer::SetIgnoredFields()
for reasons given in RFC 29.GDALVector::setSelectedFields()
sets the fields to include. Other than the specified fields will be ignored. This mimics the behavior of the-select
argument in theogr2ogr
command line utility.$setSelectedFields(fields)
' Set which fields will be included when retrieving features from the layer.
' The
fields
argument is a character vector of field names. Passing an' empty string (
""
) forfields
will reset to no ignored fields.' See the
$setIgnoredFields()
method above for more information. The data' source must provide IgnoreFields capability in order to set selected
' fields. Note that geometry fields, if desired, must be specified when setting
' selected fields, either by including named geometry field(s) or the special
' field
"OGR_GEOMETRY"
in thefields
argument.' No return value, called for side effects.
This PR also adds
GDALVector::getFieldNames()
, a convenience method as alternative to the list structure returned bygetLayerDefn()
.$getFieldNames()
' Returns a character vector of the layer's field names.