[gdal-dev] OGR datasources

Jaak Laineste (Nutiteq) jaak at nutiteq.com
Fri Oct 4 04:09:30 PDT 2013


On 03.10.2013, at 20:57, Even Rouault <even.rouault at mines-paris.org> wrote:

> Le jeudi 03 octobre 2013 16:11:23, Jaak Laineste (Nutiteq) a écrit :
>> Does anyone has a list of OGR datasources which support update ?
>> 
>> I'm using it in Android context, so "big" datasources with libraries
>> (PostGIS, ESRI etc) where it probably works are not really usable there.
>> Built-in simple file datasources are more interesting, but a general way
>> to have a list would be best.
> 
> Jaak,
> 
> There's no driver metadata that can tell you if update is supported or not by 
> just calling TestCapabability() at the driver level.
> 
> If you have an existing datasource, you can for example test the 
> OLCRandomWrite capability at the layer level.
> 
> But if I understand well your need is not to have a list that would be 
> generated dynamically but rather pick up a format that support update ? If so, 
> SQLite / Spatialite should be a good choice .

Ok, thanks, this clarifies it. My idea was to have generic mobile OGR editor with a function "open file" which would enable to open only files which can be actually edited, or at least informs user that "this works for ShapeFile, SQLite etc", but it seems this is not really possible with current APIs. 

Just a note:
ogrinfo --formats
Supported Formats:
  -> "ESRI Shapefile" (read/write)
  -> "MapInfo File" (read/write)
…

So it reports "read/write" if there is ODrCCreateDataSource, and otherwise "readonly", without checking editing (random write)

For example, as it turns out from documentation and real testing, Shapefile supports editing, but MapInfo does not, but this utility tests basic capability which is not revealed by driver API and therefore also for this tool.

Jaak



More information about the gdal-dev mailing list