Changes between Version 14 and Version 15 of FAQVector


Ignore:
Timestamp:
May 13, 2017, 8:01:30 AM (7 years ago)
Author:
Jukka Rahkonen
Comment:

How to delete features from shapefile with ogrinfo

Legend:

Unmodified
Added
Removed
Modified
  • FAQVector

    v14 v15  
    88
    99It is not possible to delete features from Shapefile using [http://gdal.org/ogr2ogr.html ogr2ogr] utility.
     10
     11However it is possible to delete features from Shapefile by using [http://gdal.org/ogrinfo.html ogrinfo] and OGR SQLite dialect. Usage:
     12
     13
     14{{{
     15ogrinfo -dialect SQLite -sql "delete from test where my_string_attribute='value_to_delete" test.shp
     16}}}
     17
    1018
    1119In order to remove entries from Shapefile, you need to call [http://gdal.org/ogr/classOGRLayer.html OGRLayer::DeleteFeature()] method, either directly from C++ program or using one of alternative interface like [http://gdal.org/ogr/ogr__api_8h.html OGR C API] or [http://trac.osgeo.org/gdal/#GDALOGRInOtherLanguages bindings to other programming languages].