FIona 1.1.18, GDAL 3.2.1


David Ignjić
 

I use docker file (later) where i install fiona via pip when i make 
import fiona

I get error:
ERROR 4: Unable to open EPSG support file gcs.csv.  Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.

Do i need compile fiona ?

Thanks 
                David





Docker file:
FROM python:3.8-slim-buster

ENV DEBIAN_FRONTEND noninteractive
ENV POETRY_VERSION 1.1.4
ENV PROJ_VERSION 7.2.1
ENV GDAL_VERSION 3.2.1

RUN apt-get update -yqq \
&& apt-get install -yqq build-essential wget pkg-config file libsqlite3-dev sqlite3 libtiff-dev netcat vim procps

# PROJ
RUN wget https://download.osgeo.org/proj/proj-${PROJ_VERSION}.tar.gz \
&& tar xzf proj-${PROJ_VERSION}.tar.gz \
&& cd proj-${PROJ_VERSION} \
&& ./configure --prefix=/usr --sysconfdir=/etc --without-curl \
&& make --quiet -j4 \
&& make --quiet install \
&& make --quiet clean \
&& cd .. \
&& rm -rf proj-${PROJ_VERSION} \
&& rm -f proj-${PROJ_VERSION}.tar.gz


# GDAL

RUN wget http://download.osgeo.org/gdal/${GDAL_VERSION}/gdal-${GDAL_VERSION}.tar.gz \
&& tar xzf gdal-${GDAL_VERSION}.tar.gz \
&& cd gdal-${GDAL_VERSION} \
&& ./configure --disable-static --prefix=/usr --sysconfdir=/etc --with-libkml \
&& make --quiet -j4\
&& make --quiet install \
&& make --quiet clean \
&& cd .. \
&& rm -rf gdal-${GDAL_VERSION} \
&& rm -f gdal-${GDAL_VERSION}.tar.gz


René Buffat
 


If you install your own proj and gdal, then you probably don't want to use the wheel version of Fiona, as the wheels contain their own version of gdal. 
With the following command you should be able to compile Fiona from source using your installed gdal:

pip install Fiona --no-binary Fiona

 

Regarding the error message: gcs.csv was replaced by a sqlite file in gdal 3.0. The current Fiona wheels include still gdal 2.4. I assume you are affected by https://github.com/Toblerity/Fiona/issues/1007

where the old gdal from the wheel finds the GDAL_DATA directory of the new gdal installation. 

 

lg rene