1

I've installed gdal v3.6.0 with conda v4.12.0, but I'm missing VFK vector driver. How can I add it?

When I run a siple script:

from osgeo import gdal

vfk_file = '727008.vfk'

ds = gdal.Open(vfk_file, gdal.GA_ReadOnly)

if ds is None:
    print('Unable to open VFK data file')
else:
    print('VFK data file opened successfully')

ds = None

This error occurs:

(geodata) PS C:\Users\MainUser\Dev\python\gdal_test> python .\test.py
ERROR 4: `727008.vfk' not recognized as a supported file format.
Unable to open VFK data file

And when I list all drivers, the VFK one is missing.

1 Answer 1

1

VFK is a vector driver. You need to import ogr instead of gdal from osgeo import ogr and use ogr.Open

ogr.Open("727008.vfk")

You can test if you have the VFK driver with ogrinfo

ogrinfo --format VFK
Format Details:
  Short Name: VFK
  Long Name: Czech Cadastral Exchange Data Format
  Supports: Vector
  Extension: vfk
  Help Topic: drivers/vector/vfk.html
  Supports: Open() - Open existing dataset.
<OpenOptionList>
  <Option name="SUPPRESS_GEOMETRY" type="boolean" description="whether to suppress geometry" default="NO" />
  <Option name="FILE_FIELD" type="boolean" description="whether to include VFK filename field" default="NO" />
</OpenOptionList>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.