[GRASS-dev] v.out.ogr patch: support OGR "update"

Benjamin Ducke benjamin.ducke at oxfordarch.co.uk
Mon May 11 05:29:26 EDT 2009


Dear all,

I have attached a very small patch to v.out.org against the
version in 6.4.SVN. It adds a "-u" flag that allows users
to update data in existing OGR sources. It's the same as
ogr2ogr's "-update" option and _very_ important for being able
to write layers as tables into existing spatial databases.
It should not be able to break any existing functionality.

If a data source does not support updates (like Shapefiles),
then Ogr_Dr_open() behaves the same as Ogr_Dr_CreateDataSource().

Despite the update, I have not been able to successfully
write OGR features to an existing (or new) SQLite DB.

OGR_L_CreateFeature() results in this error from the SQLite driver
after the first feature has been written:

ERROR 1: sqlite3_step() failed:
   SQL logic error or missing database

Strangely, the first feature is written into the table just fine,
but the error appears for all consecutive writes.

I will have to do more tests to see if this is an SQLite
and GRASS specific problem (ogr2ogr works fine).

Cheers,

Ben

-- 
Benjamin Ducke
Senior Geospatial Consultant

Oxford Archaeology
Janus House
Osney Mead
OX2 0ES
Oxford, U.K.

Tel: +44 (0)1865 263 800 (switchboard)
Tel: +44 (0)1865 980 758 (direct)
Fax :+44 (0)1865 793 496
benjamin.ducke at oxfordarch.co.uk





------
Files attached to this email may be in ISO 26300 format (OASIS Open Document Format). If you have difficulty opening them, please visit http://iso26300.info for more information.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: v.out.ogr.patch
Type: text/x-patch
Size: 2524 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/grass-dev/attachments/20090511/175cf880/v.out.ogr-0001.bin


More information about the grass-dev mailing list