There have been times where there is an error associated with the "GDAL_DATA" when trying to install/use/update Ggokit such as this one:
The error is caused by a conflicting path in a system variable called "GDAL_DATA". I followed these steps to solve it:
Install the latest version of Geokit following the installation instructions provided.
Access where the System Variables are declared following these steps and check whether there is a "GDAL_DATA" "user" or "system" variable. The "user" variable will take precedence and the "system" variable won't be used at all, so, setting up the "GDAL_DATA" in the "user" variables should be enough.
2.1 The "GDAL_DATA" path should look like this: C:\Users\<user>\Anaconda3\envs\<name of the envoriment>\Library\share\epsg_csv or C:\Users\<user>\Anaconda3\envs\<name of the envoriment>\Library\share but it might change. Important is that it should point to a folder with several files, likecoordinate_axis.csv,gcs.csv, pcs.csv, and other files.
2.2 Open a Windows Explorer window and use the "Quick search tool" to look for a pcs.csv file (or gcs.csv or coordinate_axis.csv) somewhere within C:\Users\<user>\Anaconda3\ to help windows quickly find it.
2.3 Use Shift + right-click in the file and select "copy as path" to copy the path into the clipboard
2.4 Copy the path into a text editor, delete the " at the beginning and the \gcs.csv" at the end.
Add/edit the System Variable and User Variable with name "GDAL_DATA" and value of the path
3.1 Make sure that there are not ;,"or other characters in the path value. Delete it and set it up if needed. it should look like this like this
Restart the computer.
Activate your working environment, open Jupyter Notebook, and run this script:
If this prints out a data frame like in the image, it means that the path is correct and that the file is readable. If it causes an error, then the path might be wrong or containing an extra character such as " or ;. Try modifying it again (step 3-5) until you can read the csv file. Restart your computer after any change in the System Variables/User Variable to make them effective.
Import geokit with no errors
Finished!
NOTE: the implications of having a path value with C:\Users\<user>\Anaconda3\envs\<name of the envoriment>\Library\share**\epsg_csv** instead of C:\Users\<user>\Anaconda3\envs\<name of the envoriment>\Library**\share** are at this moment unknown. It has not caused problems for me so far but there is a chance that it might with other packages. This issue will be updated in such a case
There have been times where there is an error associated with the "GDAL_DATA" when trying to install/use/update Ggokit such as this one:
The error is caused by a conflicting path in a system variable called "GDAL_DATA". I followed these steps to solve it:
Install the latest version of Geokit following the installation instructions provided.
Access where the System Variables are declared following these steps and check whether there is a "GDAL_DATA" "user" or "system" variable. The "user" variable will take precedence and the "system" variable won't be used at all, so, setting up the "GDAL_DATA" in the "user" variables should be enough.
2.1 The "GDAL_DATA" path should look like this:
C:\Users\<user>\Anaconda3\envs\<name of the envoriment>\Library\share\epsg_csv
orC:\Users\<user>\Anaconda3\envs\<name of the envoriment>\Library\share
but it might change. Important is that it should point to a folder with several files, likecoordinate_axis.csv
,gcs.csv
,pcs.csv
, and other files.2.2 Open a Windows Explorer window and use the "Quick search tool" to look for a
pcs.csv
file (orgcs.csv
orcoordinate_axis.csv
) somewhere withinC:\Users\<user>\Anaconda3\
to help windows quickly find it.2.3 Use
Shift + right-click
in the file and select "copy as path" to copy the path into the clipboard2.4 Copy the path into a text editor, delete the
"
at the beginning and the\gcs.csv"
at the end.3.1 Make sure that there are not
;,"
or other characters in the path value. Delete it and set it up if needed. it should look like this like thisRestart the computer.
Activate your working environment, open Jupyter Notebook, and run this script:
import pandas as pd
import os
gdal_data = os.environ['GDAL_DATA']
pd.read_csv(os.path.join(gdal_data,"gcs.csv")).head()
If this prints out a data frame like in the image, it means that the path is correct and that the file is readable. If it causes an error, then the path might be wrong or containing an extra character such as
" or ;
. Try modifying it again (step 3-5) until you can read the csv file. Restart your computer after any change in the System Variables/User Variable to make them effective.Finished!
NOTE: the implications of having a path value with
C:\Users\<user>\Anaconda3\envs\<name of the envoriment>\Library\share**\epsg_csv**
instead ofC:\Users\<user>\Anaconda3\envs\<name of the envoriment>\Library**\share**
are at this moment unknown. It has not caused problems for me so far but there is a chance that it might with other packages. This issue will be updated in such a case