I am trying to use ogr2ogr to convert a SHP to KML. I want to use the LIBKML driver because it has more options for customizing the KML output. Code is below (running in Jupyter notebook).
! ogr2ogr -f LIBKML out.kml in.shp
ERROR 1: Unable to find driver `LIBKML'.
Windows, Python 3.7, gdal 3.3.1, libkml 1.3.0
I'm in a new Anaconda environment, set up like this:
conda create -n gdal python=3.7
conda activate gdal
conda config --env --add channels conda-forge
conda config --env --set channel_priority strict
conda install -c conda-forge gdal
conda install -c conda-forge matplotlib pandas geopandas
conda install -c conda-forge jupyterlab notebook
ipython kernel install --name "gdal" --user
conda install -c conda-forge libkml
The same question was asked here, and based on the comments I can see ogr doesn't recognize the libkml driver even though I installed it and it shows up in conda list
! ogrinfo --formats|findstr KML
KML -vector- (rw+v): Keyhole Markup Language (KML)
conda update gdal
since I installed libkml after gdal, but the error message persists