Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
264: Added wrapper for OGR_L_SetFeature r=rmanoka a=geohardtke - [x] I agree to follow the project's [code of conduct](https://github.com/georust/gdal/blob/master/CODE_OF_CONDUCT.md). - [x] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users. --- Hi, I tried to find a way to update the value of a field in a vector and couldn't find a way to achieve that. Maybe I missed something? If so, sorry. Otherwise here is a pull request that implements a wrapper for OGR_L_SetFeature. It can be used as follows: ```rust let ds_options = DatasetOptions { open_flags: GdalOpenFlags::GDAL_OF_UPDATE, ..DatasetOptions::default() }; let ds = Dataset::open_ex("three_layer_ds.s3db"), ds_options).unwrap(); let mut layer = ds.layer(0).unwrap(); let fids: Vec<u64> = layer.features().map(|f| f.fid().unwrap()).collect(); let feature = layer.feature(fids[0]).unwrap(); feature.set_field_integer("id", 1).ok(); layer.set_feature(feature).ok(); ``` Co-authored-by: Leonardo Hardtke <[email protected]> Co-authored-by: geohardtke <[email protected]>
- Loading branch information