# VFK - Czech Cadastral Exchange Data Format

This driver reads VFK files, i.e. data in the Czech cadastral exchange data format. The VFK file is recognized as an OGR datasource with zero or more OGR layers.

Note: starting with OGR 1.10, the driver is compiled only if GDAL is built with SQLite support.

Points are represented as wkbPoints, lines and boundaries as wkbLineStrings and areas as wkbPolygons. wkbMulti* primitives are not used. Feature types cannot be mixed in one layer.

### Configuration

Starting with OGR 1.9, the driver reads and writes VFK data from/to internal SQLite database. Default name for the database is "input_vfk_file.db". Since OGR 1.10, you can define an alternative DB name with OGR_VFK_DB_NAME configuration option. If OGR_VFK_DB_OVERWRITE=YES configuration option is given, than the driver overwrites existing SQLite database and reads data from original input VFK file into newly created DB. Since OGR 1.11, if OGR_VFK_DB_DELETE=YES configuration option is given than the driver deletes the internal SQLite database when closing the data source.

Starting with OGR 1.10, resolved geometries are stored also in SQLite database. It means that geometries are resolved only once when building SQLite database from original VFK data. Geometries are stored in WKB format. Note that GDAL doesn't need to be built with SpatiaLite support. Geometries are not stored in DB when OGR_VFK_DB_SPATIAL=NO configuration option is given. In this case the geometries are resolved from DB.

### Internal working and performance tweaking

Since OGR 1.9, the driver uses an internal SQLite database to resolve geometries. By default, this file will be written in the same directory as input VFK file. If SQLite database already exists then the driver reads VFK features directly from the database (and not from original VFK file).

Since OGR 1.11, the driver reads by default all data blocks. When configuration option OGR_VFK_DB_READ_ALL_BLOCKS=NO is given than the driver reads only data blocks which are requested by the user.

## Datasource name

Datasource name is a full path to the VFK file.

The driver supports reading files managed by VSI Virtual File System API, which include "regular" files, as well as files in the /vsizip/, /vsigzip/, and /vsicurl/ read-only domains.

## Layer names

VFK data blocks are used as layer names.

## Filters

### Attribute filter

OGR internal SQL engine is used to evaluate the expression. Evaluation is done once when the attribute filter is set.

### Spatial filter

Bounding boxes of features stored in topology structure are used to evaluate if a features matches current spatial filter. Evaluation is done once when the spatial filter is set.

## References

- OGR VFK Driver Implementation Issues
- Open Source Tools for VFK format (in Czech)
- Czech cadastral exchange data format documentation (in Czech)