Changes between Version 7 and Version 8 of FAQVector


Ignore:
Timestamp:
Jun 20, 2009, 2:09:42 PM (15 years ago)
Author:
Mateusz Łoskot
Comment:

QA: How can I delete feature from Shapefile?

Legend:

Unmodified
Added
Removed
Modified
  • FAQVector

    v7 v8  
    33[[PageOutline(2,,inline)]]
    44
    5 == How can I merge hundreds of shapefiles? ==
     5== How can I delete feature from Shapefile? ==
     6
     7This question was asked a few times on the mailing list, for instance [http://lists.osgeo.org/pipermail/gdal-dev/2007-March/011992.html here] and [http://lists.osgeo.org/pipermail/gdal-dev/2007-March/012109.html here]. It's recommended to look at these threads as they provide explanation on how to delete entries from [http://gdal.org/ogr/drv_shapefile.html Shapefile].
     8
     9It is not possible to delete features from Shapefile using [http://gdal.org/ogr2ogr.html ogr2ogr] utility.
     10
     11In 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].
     12
     13== How can I merge hundreds of Shapefiles? ==
    614
    715Here's a bash script to bulk load a directory of shapefiles that have the same schema to postgis.  It could obviously be made smarter, but it seems to do the trick.