[gdal-dev] how to implement user specified events and handlers
Martin Landa
landa.martin at gmail.com
Tue Oct 15 03:36:08 PDT 2013
Hi all,
I wonder if there is a way how to implement mechanism for
user-specified events and handlers in GDAL/OGR.
I am implementing a Python script which checks VFK file using OGR
driver [1]. This script reads VFK data and stores them in SQLite
database which is created by the OGR driver.
Beside some geometry checks the script should do some extra
user-defined checks on the original VFK file. To avoid double reading
of the file (first by the script and then by the OGR driver) I would
like to use mechanism of events and handlers. In other words, event
for reading a new line from the VFK file [2] and the handler (callback
subroutine in Python script) which would do some extra checks on the
line [3].
Any idea how it should be correctly implemented in VFK driver and the
Python script? Thanks a lot for any hits in advance!
Martin
[1] http://gdal.org/ogr/drv_vfk.html
[2] http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/vfk/vfkreader.cpp#L125
[3] https://github.com/landam/ogr-vfk-testing/blob/master/read-vfk-test/read-vfk.py#L52
--
Martin Landa <landa.martin gmail.com> * http://geo.fsv.cvut.cz/~landa
More information about the gdal-dev
mailing list