[gdal-dev] How to know which formats allow editing with ogrinfo?

Even Rouault even.rouault at spatialys.com
Fri Nov 15 03:58:34 PST 2019


On vendredi 15 novembre 2019 08:52:48 CET Rahkonen Jukka (MML) wrote:
> Hi,
> 
> Shapefile can be edited with ogrinfo
> ogrinfo -dialect SQLite -sql "update foo set bar='14'" foo.shp
> 
> GML opens always as read-only with -sql option
> ogrinfo -sql "select * from foo" foo.gml
> Had to open data source read-only.
> INFO: Open of `foo.gml'
>       using driver `GML' successful.
> 
> How can I know which formats support editing with -sql and which not? I
> could not find any obvious metadata by checking the capabilities of a few
> different drivers.

There's indeed no driver-level metadata indicating support for updates (update 
through SQL is just a particular case). With a dataset opened, on a layer, 
with the API you can query for fine grain capabilities with
TestCapability(OLCRandomWrite/OLCDeleteFeature/etc...)

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list