You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import os
def checkpaths():
gdal_data = os.environ.get('GDAL_DATA')
if gdal_data:
print(f"GDAL_DATA is set to {gdal_data}")
if os.path.exists(gdal_data+"/gcs.csv"):
print("GDAL_DATA seems correct")
else:
print("GDAL_DATA seems BROKEN")
else:
print(f"GDAL_DATA is NOT set")
proj_lib = os.environ.get('PROJ_LIB')
if proj_lib:
print(f"PROJ_LIB is set to {proj_lib}")
if os.path.exists(proj_lib+"/epsg"):
print("PROJ_LIB seems correct")
else:
print("PROJ_LIB seems BROKEN")
else:
print(f"PROJ_LIB is NOT set")
>>> checkpaths()
GDAL_DATA is NOT set
PROJ_LIB is NOT set
Importing Fiona now should have it update the paths to its own env, but it only sets the PROJ_LIB one.
>>> import fiona
>>> checkpaths()
GDAL_DATA is NOT set
PROJ_LIB is set to /home/kannes/.local/lib/python3.7/site-packages/fiona/proj_data
PROJ_LIB seems correct
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.
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.
ERROR 6: No translation for an empty SRS to PROJ.4 format is known.
{'type': 'Point', 'coordinates': (2.2945, 48.858222)}
If I manually set the correct GDAL_PATHbefore importing Fiona everything works fine:
# you MUST use a pristine Python session for this
import os
os.environ['GDAL_DATA'] = "/home/hannes/.local/lib/python3.7/site-packages/fiona/gdal_data"
import fiona
from fiona.transform import transform_geom
from fiona.crs import from_epsg
eiffel_tower = {'type': 'Point', 'coordinates': (2.2945, 48.858222)}
crs_source_epsg = from_epsg(4326)
crs_target_epsg = from_epsg(25831)
transformed = transform_geom(crs_source_epsg, crs_target_epsg, eiffel_tower)
print(transformed)
prints {'type': 'Point', 'coordinates': (448251.81788407586, 5411935.123097671)}
The text was updated successfully, but these errors were encountered:
Again/still struggling with the gdal and proj stuff (re #673 and #691).
From what I read, Fiona should set
GDAL_PATH
andPROJ_LIB
to its own paths if there were no such paths defined in the environment yet.I do not have
GDAL_PATH
orPROJ_LIB
set, but Fiona still does not work :o)I installed the latest version from pypi at https://pypi.org/project/Fiona/#files
Importing Fiona now should have it update the paths to its own env, but it only sets the
PROJ_LIB
one.This means that e.g. transformations will fail:
prints:
If I manually set the correct
GDAL_PATH
before importing Fiona everything works fine:prints
{'type': 'Point', 'coordinates': (448251.81788407586, 5411935.123097671)}
The text was updated successfully, but these errors were encountered: