Giter Site home page Giter Site logo

geokit's Introduction

master dev
Build Status Build Status

Forschungszentrum Juelich Logo

GeoKit - Geospatial toolkit for Python

GeoKit communicates directly with functions and objects within the Geospatial Data Abstraction Library (GDAL) and exposes them in such a way that is particularly useful for programmatic general purpose geospatial analyses. It gives low overhead control of fundamental operations; such as reading, writing, and mutating geospatial data sets, manipulating and translating geometries, warping and resampling raster data, and much more. Via the RegionMask object, GeoKit even allows for seamless integration of information expressed across multiple geospatial datasets in many formats and reference systems into the context of a single region.

GeoKit is not intended to replace the GDAL library, as only very small subset of GDAL's capabilities are exposed. Nor is it intended to compete with other libraries with similar functionalities. Instead GeoKit evolved in an ad hoc manner in order to realize the Geospatial Land Eligibility for Energy Systems (GLAES) model which is intended for rapid land eligibility analyses of renewable energy systems and is also available on GitHub. Nevertheless, GeoKit quickly emerged as a general purpose GIS toolkit with capabilities far beyond computing land eligibility. Therefore, it is our pleasure to offer it to anyone who is interested in its use.

DOI

Features

  • Direct exposure of functions and objects in the GDAL library
  • Reading, writing, and manipulating raster and vector datasets
  • Translation between data formats and projection systems
  • Direct conversion of raster data into NumPy matrices

Installation

Installation via conda-forge

The easiest way to install GeoKit into a new environment is from conda-forge with:

conda create -n geokit -c conda-forge geokit

or into an existing environment with:

conda install -c conda-forge geokit

Installation from a local folder

  1. First clone a local copy of the repository to your computer, and move into the created directory
git clone https://github.com/FZJ-IEK3-VSA/geokit.git
cd geokit
  1. (Alternative) If you want to use the 'dev' branch (or another branch) then use:
git checkout dev
  1. When using Anaconda / (Micro-)Mamba (recommended), GeoKit should be installable to a new environment with:
conda env create --file requirements.yml
conda activate geokit
pip install . --no-deps
  1. (Alternative) Or into an existing environment with:
conda env update --file requirements.yml -n <ENVIRONMENT-NAME>
conda activate geokit
pip install . --no-deps
  1. (Alternative) If you want to install GeoKit in editable mode, and also with jupyter notebook and with testing functionalities use:
conda env create --file requirements-dev.yml
conda activate geokit
pip install . --no-deps -e

Examples

See the Examples page

Docker

We are trying to get GeoKit to work within a Docker container. Try it out!

  • First pull the image with:
docker pull sevberg/geokit:latest
  • You can then start a basic python interpreter with:
docker run -it sevberg/geokit:latest -c "python"
  • Or you can start a jupyter notebook using:
docker run -it \
    -p 8888:8888 \
    sevberg/geokit:latest \
    -c "jupyter notebook --ip='*' --port=8888 --no-browser --allow-root"
  • Which can then be connected to at the address "localhost:8888:"
  • The API Key can be found from the output of the earlier command
  • Finally, you might want to mount a volume to access geospatial data. For this you can use:
docker run -it \
    --mount target=/notebooks,type=bind,src=<PATH-TO-DIRECTORY> \
    -p 8888:8888 \
    sevberg/geokit:latest  \
    -c "jupyter notebook --notebook-dir=/notebooks --ip='*' --port=8888 --no-browser --allow-root"

License

MIT License

Active Developers: Julian Schönau, Rachel Maier, Christoph Winkler, Shitab Ishmam, David Franzmann, Julian Belina, Noah Pflugradt, Heidi Heinrichs, Jochen Linßen, Detlef Stolten

Alumni: David Severin Ryberg, Martin Robinius, Stanley Risch

You should have received a copy of the MIT License along with this program.
If not, see https://opensource.org/licenses/MIT

About Us

Institute image IEK-3

We are the Institute of Energy and Climate Research - Techno-economic Systems Analysis (IEK-3) belonging to the Forschungszentrum Jülich. Our interdisciplinary department's research is focusing on energy-related process and systems analyses. Data searches and system simulations are used to determine energy and mass balances, as well as to evaluate performance, emissions and costs of energy systems. The results are used for performing comparative assessment studies between the various systems. Our current priorities include the development of energy strategies, in accordance with the German Federal Government’s greenhouse gas reduction targets, by designing new infrastructures for sustainable and secure energy supply chains and by conducting cost analysis studies for integrating new technologies into future energy market frameworks.

Acknowledgment

This work was supported by the Helmholtz Association under the Joint Initiative "Energy System 2050 A Contribution of the Research Field Energy".

Helmholtz Logo

geokit's People

Contributors

chrisjwin avatar d-franzmann avatar julianbelina avatar noah80 avatar ra-maier avatar s-risch avatar sevberg avatar shitabishmam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

geokit's Issues

Undedectet Issue with numpy>=1.24 in geokit 1.40

Geokit 1.40 is incompatible to numpy numpy>=1.24. The dependency constraint should be included.

The error occurs the buildMask function. It can be repoduced by running the test_ExclusionCalculator.py from glaes.

----------------------------- Captured stderr call -----------------------------
pj_obj_create: Open of /home/runner/miniconda3/envs/test_env/share/proj failed
________________________ test_ExclusionCalculator_save _________________________

def test_ExclusionCalculator_save():

   ec = gl.ExclusionCalculator(aachenShape)

glaes/glaes/test/test_ExclusionCalculator.py:60:

glaes/glaes/core/ExclusionCalculator.py:238: in init
s.maskPixels = s.region.mask.sum()
../../../miniconda3/envs/test_env/lib/python3.8/site-packages/geokit/core/regionmask.py:470: in mask
self.buildMask()
../../../miniconda3/envs/test_env/lib/python3.8/site-packages/geokit/core/regionmask.py:457: in buildMask
**kwargs).astype(np.bool)

attr = 'bool'

def __getattr__(attr):
    # Warn for expired attributes, and return a dummy function
    # that always raises an exception.
    import warnings
    try:
        msg = __expired_functions__[attr]
    except KeyError:
        pass
    else:
        warnings.warn(msg, DeprecationWarning, stacklevel=2)

        def _expired(*args, **kwds):
            raise RuntimeError(msg)

        return _expired

    # Emit warnings for deprecated attributes
    try:
        val, msg = __deprecated_attrs__[attr]
    except KeyError:
        pass
    else:
        warnings.warn(msg, DeprecationWarning, stacklevel=2)
        return val

    if attr in __future_scalars__:
        # And future warnings for those that will change, but also give
        # the AttributeError
        warnings.warn(
            f"In the future `np.{attr}` will be defined as the "
            "corresponding NumPy scalar.", FutureWarning, stacklevel=2)

    if attr in __former_attrs__:
       raise AttributeError(__former_attrs__[attr])

E AttributeError: module 'numpy' has no attribute 'bool'.
E np.bool was a deprecated alias for the builtin bool. To avoid this error in existing code, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here.
E The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
E https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations

../../../miniconda3/envs/test_env/lib/python3.8/site-packages/numpy/init.py:305: AttributeError

test_LocationSet_splitKMeans fails on geokit 1.40

The test_LocationSet_splitKMeans fails on geokit 1.40

_________________________ test_LocationSet_splitKMeans _________________________

    def test_LocationSet_splitKMeans():
        pts = [(-1, -1), (-1, -1.5), (2, 1), (2, 1.5),
               (2, -1), (2, -1.5), (2, -1.25)]
        locs = LocationSet(pts)
    
        sublocsGen = locs.splitKMeans(groups=3, random_state=0)
    
        sublocs = list(sublocsGen)
    
>       assert sublocs[0].count == 2
E       assert 3 == 2
E        +  where 3 =  , Lon      , Lat\n0, 2.00000  , -1.00000 \n1, 2.00000  , -1.50000 \n2, 2.00000  , -1.25000 \n.count

I am using the following environment on Windows 11:

# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
alsa-lib                  1.2.8                h166bdaf_0    conda-forge
anyio                     4.3.0              pyhd8ed1ab_0    conda-forge
argon2-cffi               23.1.0             pyhd8ed1ab_0    conda-forge
argon2-cffi-bindings      21.2.0           py39hd1e30aa_4    conda-forge
arrow                     1.3.0              pyhd8ed1ab_0    conda-forge
astroid                   3.0.3            py39hf3d152e_0    conda-forge
asttokens                 2.4.1              pyhd8ed1ab_0    conda-forge
async-lru                 2.0.4              pyhd8ed1ab_0    conda-forge
attr                      2.5.1                h166bdaf_1    conda-forge
attrs                     23.2.0             pyh71513ae_0    conda-forge
autopep8                  2.0.4              pyhd8ed1ab_0    conda-forge
babel                     2.14.0             pyhd8ed1ab_0    conda-forge
beautifulsoup4            4.12.3             pyha770c72_0    conda-forge
bleach                    6.1.0              pyhd8ed1ab_0    conda-forge
blosc                     1.21.5               h0f2a231_0    conda-forge
boost-cpp                 1.78.0               h5adbc97_2    conda-forge
brotli                    1.1.0                hd590300_1    conda-forge
brotli-bin                1.1.0                hd590300_1    conda-forge
brotli-python             1.1.0            py39h3d6467e_1    conda-forge
bzip2                     1.0.8                hd590300_5    conda-forge
c-ares                    1.27.0               hd590300_0    conda-forge
ca-certificates           2024.2.2             hbcca054_0    conda-forge
cached-property           1.5.2                hd8ed1ab_1    conda-forge
cached_property           1.5.2              pyha770c72_1    conda-forge
cairo                     1.16.0            ha61ee94_1014    conda-forge
certifi                   2024.2.2           pyhd8ed1ab_0    conda-forge
cffi                      1.16.0           py39h7a31438_0    conda-forge
cfitsio                   4.1.0                hd9d235c_0    conda-forge
charset-normalizer        3.3.2              pyhd8ed1ab_0    conda-forge
colorama                  0.4.6              pyhd8ed1ab_0    conda-forge
comm                      0.2.1              pyhd8ed1ab_0    conda-forge
contourpy                 1.2.0            py39h7633fee_0    conda-forge
coverage                  7.4.1            py39hd1e30aa_0    conda-forge
curl                      8.1.2                h409715c_0    conda-forge
cycler                    0.12.1             pyhd8ed1ab_0    conda-forge
dbus                      1.13.6               h5008d03_3    conda-forge
debugpy                   1.8.1            py39h3d6467e_0    conda-forge
decorator                 5.1.1              pyhd8ed1ab_0    conda-forge
defusedxml                0.7.1              pyhd8ed1ab_0    conda-forge
descartes                 1.1.0                      py_4    conda-forge
dill                      0.3.8              pyhd8ed1ab_0    conda-forge
entrypoints               0.4                pyhd8ed1ab_0    conda-forge
exceptiongroup            1.2.0              pyhd8ed1ab_2    conda-forge
executing                 2.0.1              pyhd8ed1ab_0    conda-forge
expat                     2.5.0                hcb278e6_1    conda-forge
fftw                      3.3.10          nompi_hc118613_108    conda-forge
font-ttf-dejavu-sans-mono 2.37                 hab24e00_0    conda-forge
font-ttf-inconsolata      3.000                h77eed37_0    conda-forge
font-ttf-source-code-pro  2.038                h77eed37_0    conda-forge
font-ttf-ubuntu           0.83                 h77eed37_1    conda-forge
fontconfig                2.14.2               h14ed4e7_0    conda-forge
fonts-conda-ecosystem     1                             0    conda-forge
fonts-conda-forge         1                             0    conda-forge
fonttools                 4.49.0           py39hd1e30aa_0    conda-forge
fqdn                      1.5.1              pyhd8ed1ab_0    conda-forge
freetype                  2.12.1               h267a509_2    conda-forge
freexl                    1.0.6                h166bdaf_1    conda-forge
gdal                      3.4.3            py39hc6cd174_1    conda-forge
geokit                    1.4.0              pyhd8ed1ab_1    conda-forge
geos                      3.11.1               h27087fc_0    conda-forge
geotiff                   1.7.1                ha76d385_4    conda-forge
gettext                   0.21.1               h27087fc_0    conda-forge
giflib                    5.2.1                h0b41bf4_3    conda-forge
glib                      2.78.1               hfc55251_0    conda-forge
glib-tools                2.78.1               hfc55251_0    conda-forge
graphite2                 1.3.13            h58526e2_1001    conda-forge
gst-plugins-base          1.22.0               h4243ec0_2    conda-forge
gstreamer                 1.22.0               h25f0c4b_2    conda-forge
gstreamer-orc             0.4.37               hd590300_0    conda-forge
h11                       0.14.0             pyhd8ed1ab_0    conda-forge
h2                        4.1.0              pyhd8ed1ab_0    conda-forge
harfbuzz                  6.0.0                h8e241bc_0    conda-forge
hdf4                      4.2.15               h9772cbc_5    conda-forge
hdf5                      1.12.2          nompi_h4df4325_101    conda-forge
hpack                     4.0.0              pyh9f0ad1d_0    conda-forge
httpcore                  1.0.4              pyhd8ed1ab_0    conda-forge
httpx                     0.27.0             pyhd8ed1ab_0    conda-forge
hyperframe                6.0.1              pyhd8ed1ab_0    conda-forge
icu                       70.1                 h27087fc_0    conda-forge
idna                      3.6                pyhd8ed1ab_0    conda-forge
importlib-metadata        7.0.1              pyha770c72_0    conda-forge
importlib-resources       6.1.1              pyhd8ed1ab_0    conda-forge
importlib_metadata        7.0.1                hd8ed1ab_0    conda-forge
importlib_resources       6.1.1              pyhd8ed1ab_0    conda-forge
iniconfig                 2.0.0              pyhd8ed1ab_0    conda-forge
ipykernel                 6.29.2             pyhd33586a_0    conda-forge
ipython                   8.18.1             pyh707e725_3    conda-forge
ipywidgets                8.1.2              pyhd8ed1ab_0    conda-forge
isoduration               20.11.0            pyhd8ed1ab_0    conda-forge
isort                     5.13.2             pyhd8ed1ab_0    conda-forge
jack                      1.9.22               h11f4161_0    conda-forge
jedi                      0.19.1             pyhd8ed1ab_0    conda-forge
jinja2                    3.1.3              pyhd8ed1ab_0    conda-forge
joblib                    1.3.2              pyhd8ed1ab_0    conda-forge
jpeg                      9e                   h0b41bf4_3    conda-forge
json-c                    0.16                 hc379101_0    conda-forge
json5                     0.9.17             pyhd8ed1ab_0    conda-forge
jsonpointer               2.4              py39hf3d152e_3    conda-forge
jsonschema                4.21.1             pyhd8ed1ab_0    conda-forge
jsonschema-specifications 2023.12.1          pyhd8ed1ab_0    conda-forge
jsonschema-with-format-nongpl 4.21.1             pyhd8ed1ab_0    conda-forge
jupyter                   1.0.0             pyhd8ed1ab_10    conda-forge
jupyter-lsp               2.2.2              pyhd8ed1ab_0    conda-forge
jupyter_client            8.6.0              pyhd8ed1ab_0    conda-forge
jupyter_console           6.6.3              pyhd8ed1ab_0    conda-forge
jupyter_core              5.7.1            py39hf3d152e_0    conda-forge
jupyter_events            0.9.0              pyhd8ed1ab_0    conda-forge
jupyter_server            2.12.5             pyhd8ed1ab_0    conda-forge
jupyter_server_terminals  0.5.2              pyhd8ed1ab_0    conda-forge
jupyterlab                4.1.2              pyhd8ed1ab_0    conda-forge
jupyterlab_pygments       0.3.0              pyhd8ed1ab_1    conda-forge
jupyterlab_server         2.25.3             pyhd8ed1ab_0    conda-forge
jupyterlab_widgets        3.0.10             pyhd8ed1ab_0    conda-forge
kealib                    1.5.0                ha7026e8_0    conda-forge
keyutils                  1.6.1                h166bdaf_0    conda-forge
kiwisolver                1.4.5            py39h7633fee_1    conda-forge
krb5                      1.20.1               h81ceb04_0    conda-forge
lame                      3.100             h166bdaf_1003    conda-forge
lcms2                     2.14                 h6ed2654_0    conda-forge
ld_impl_linux-64          2.40                 h41732ed_0    conda-forge
lerc                      4.0.0                h27087fc_0    conda-forge
libaec                    1.1.2                h59595ed_1    conda-forge
libblas                   3.9.0           21_linux64_openblas    conda-forge
libbrotlicommon           1.1.0                hd590300_1    conda-forge
libbrotlidec              1.1.0                hd590300_1    conda-forge
libbrotlienc              1.1.0                hd590300_1    conda-forge
libcap                    2.67                 he9d0100_0    conda-forge
libcblas                  3.9.0           21_linux64_openblas    conda-forge
libclang                  15.0.7          default_hb11cfb5_4    conda-forge
libclang13                15.0.7          default_ha2b6cf4_4    conda-forge
libcups                   2.3.3                h36d4200_3    conda-forge
libcurl                   8.1.2                h409715c_0    conda-forge
libdap4                   3.20.6               hd7c4107_2    conda-forge
libdb                     6.2.32               h9c3ff4c_0    conda-forge
libdeflate                1.14                 h166bdaf_0    conda-forge
libedit                   3.1.20191231         he28a2e2_2    conda-forge
libev                     4.33                 hd590300_2    conda-forge
libevent                  2.1.10               h28343ad_4    conda-forge
libexpat                  2.5.0                hcb278e6_1    conda-forge
libffi                    3.4.2                h7f98852_5    conda-forge
libflac                   1.4.3                h59595ed_0    conda-forge
libgcc-ng                 13.2.0               h807b86a_5    conda-forge
libgcrypt                 1.10.3               hd590300_0    conda-forge
libgdal                   3.4.3                hdfd6431_1    conda-forge
libgfortran-ng            13.2.0               h69a702a_5    conda-forge
libgfortran5              13.2.0               ha4646dd_5    conda-forge
libglib                   2.78.1               hebfc3b9_0    conda-forge
libgomp                   13.2.0               h807b86a_5    conda-forge
libgpg-error              1.47                 h71f35ed_0    conda-forge
libiconv                  1.17                 hd590300_2    conda-forge
libkml                    1.3.0             h01aab08_1016    conda-forge
liblapack                 3.9.0           21_linux64_openblas    conda-forge
libllvm15                 15.0.7               hadd5161_1    conda-forge
libnetcdf                 4.8.1           nompi_h261ec11_106    conda-forge
libnghttp2                1.58.0               h47da74e_0    conda-forge
libnsl                    2.0.1                hd590300_0    conda-forge
libogg                    1.3.4                h7f98852_1    conda-forge
libopenblas               0.3.26          pthreads_h413a1c8_0    conda-forge
libopus                   1.3.1                h7f98852_1    conda-forge
libpng                    1.6.42               h2797004_0    conda-forge
libpq                     15.2                 hb675445_0    conda-forge
librttopo                 1.1.0               ha49c73b_12    conda-forge
libsndfile                1.2.2                hc60ed4a_1    conda-forge
libsodium                 1.0.18               h36c2ea0_1    conda-forge
libspatialite             5.0.1               h7c8129e_22    conda-forge
libsqlite                 3.45.1               h2797004_0    conda-forge
libssh2                   1.11.0               h0841786_0    conda-forge
libstdcxx-ng              13.2.0               h7e041cc_5    conda-forge
libsystemd0               253                  h8c4010b_1    conda-forge
libtiff                   4.4.0                h82bc61c_5    conda-forge
libtool                   2.4.7                h27087fc_0    conda-forge
libudev1                  253                  h0b41bf4_1    conda-forge
libuuid                   2.38.1               h0b41bf4_0    conda-forge
libvorbis                 1.3.7                h9c3ff4c_0    conda-forge
libwebp-base              1.3.2                hd590300_0    conda-forge
libxcb                    1.13              h7f98852_1004    conda-forge
libxkbcommon              1.5.0                h79f4944_1    conda-forge
libxml2                   2.10.3               hca2bb57_4    conda-forge
libzip                    1.10.1               h2629f0a_3    conda-forge
libzlib                   1.2.13               hd590300_5    conda-forge
lz4-c                     1.9.4                hcb278e6_0    conda-forge
markupsafe                2.1.5            py39hd1e30aa_0    conda-forge
matplotlib                3.8.3            py39hf3d152e_0    conda-forge
matplotlib-base           3.8.3            py39he9076e7_0    conda-forge
matplotlib-inline         0.1.6              pyhd8ed1ab_0    conda-forge
mccabe                    0.7.0              pyhd8ed1ab_0    conda-forge
mistune                   3.0.2              pyhd8ed1ab_0    conda-forge
more-itertools            10.2.0             pyhd8ed1ab_0    conda-forge
mpg123                    1.32.4               h59595ed_0    conda-forge
munkres                   1.1.4              pyh9f0ad1d_0    conda-forge
mysql-common              8.0.33               hf1915f5_6    conda-forge
mysql-libs                8.0.33               hca2cd23_6    conda-forge
nbclient                  0.8.0              pyhd8ed1ab_0    conda-forge
nbconvert                 7.16.1             pyhd8ed1ab_0    conda-forge
nbconvert-core            7.16.1             pyhd8ed1ab_0    conda-forge
nbconvert-pandoc          7.16.1             pyhd8ed1ab_0    conda-forge
nbformat                  5.9.2              pyhd8ed1ab_0    conda-forge
ncurses                   6.4                  h59595ed_2    conda-forge
nest-asyncio              1.6.0              pyhd8ed1ab_0    conda-forge
notebook                  7.1.0              pyhd8ed1ab_0    conda-forge
notebook-shim             0.2.4              pyhd8ed1ab_0    conda-forge
nspr                      4.35                 h27087fc_0    conda-forge
nss                       3.98                 h1d7d5a4_0    conda-forge
numpy                     1.23.5           py39h3d75532_0    conda-forge
openjpeg                  2.5.0                h7d73246_1    conda-forge
openssl                   3.1.5                hd590300_0    conda-forge
overrides                 7.7.0              pyhd8ed1ab_0    conda-forge
packaging                 23.2               pyhd8ed1ab_0    conda-forge
pandas                    2.2.0            py39hddac248_0    conda-forge
pandoc                    3.1.12.1             ha770c72_0    conda-forge
pandocfilters             1.5.0              pyhd8ed1ab_0    conda-forge
parso                     0.8.3              pyhd8ed1ab_0    conda-forge
pcre2                     10.40                hc3806b6_0    conda-forge
pexpect                   4.9.0              pyhd8ed1ab_0    conda-forge
pickleshare               0.7.5                   py_1003    conda-forge
pillow                    9.2.0            py39hf3a2cdf_3    conda-forge
pip                       24.0               pyhd8ed1ab_0    conda-forge
pixman                    0.43.2               h59595ed_0    conda-forge
pkgutil-resolve-name      1.3.10             pyhd8ed1ab_1    conda-forge
platformdirs              4.2.0              pyhd8ed1ab_0    conda-forge
pluggy                    0.13.1           py39hf3d152e_4    conda-forge
ply                       3.11                       py_1    conda-forge
poppler                   22.12.0              h92391eb_0    conda-forge
poppler-data              0.4.12               hd8ed1ab_0    conda-forge
postgresql                15.2                 h3248436_0    conda-forge
proj                      9.1.0                h93bde94_0    conda-forge
prometheus_client         0.20.0             pyhd8ed1ab_0    conda-forge
prompt-toolkit            3.0.42             pyha770c72_0    conda-forge
prompt_toolkit            3.0.42               hd8ed1ab_0    conda-forge
psutil                    5.9.8            py39hd1e30aa_0    conda-forge
pthread-stubs             0.4               h36c2ea0_1001    conda-forge
ptyprocess                0.7.0              pyhd3deb0d_0    conda-forge
pulseaudio                16.1                 hcb278e6_3    conda-forge
pulseaudio-client         16.1                 h5195f5e_3    conda-forge
pulseaudio-daemon         16.1                 ha8d29e2_3    conda-forge
pure_eval                 0.2.2              pyhd8ed1ab_0    conda-forge
py                        1.11.0             pyh6c4a22f_0    conda-forge
pycodestyle               2.11.1             pyhd8ed1ab_0    conda-forge
pycparser                 2.21               pyhd8ed1ab_0    conda-forge
pygments                  2.17.2             pyhd8ed1ab_0    conda-forge
pylint                    3.0.3              pyhd8ed1ab_0    conda-forge
pyparsing                 3.1.1              pyhd8ed1ab_0    conda-forge
pyqt                      5.15.9           py39h52134e7_5    conda-forge
pyqt5-sip                 12.12.2          py39h3d6467e_5    conda-forge
pysocks                   1.7.1              pyha2e5f31_6    conda-forge
pytest                    6.2.4            py39hf3d152e_0    conda-forge
pytest-cov                4.1.0              pyhd8ed1ab_0    conda-forge
python                    3.9.18          h0755675_0_cpython    conda-forge
python-dateutil           2.8.2              pyhd8ed1ab_0    conda-forge
python-fastjsonschema     2.19.1             pyhd8ed1ab_0    conda-forge
python-json-logger        2.0.7              pyhd8ed1ab_0    conda-forge
python-tzdata             2024.1             pyhd8ed1ab_0    conda-forge
python_abi                3.9                      4_cp39    conda-forge
pytz                      2024.1             pyhd8ed1ab_0    conda-forge
pyyaml                    6.0.1            py39hd1e30aa_1    conda-forge
pyzmq                     25.1.2           py39h8c080ef_0    conda-forge
qt-main                   5.15.8               h5d23da1_6    conda-forge
qtconsole-base            5.5.1              pyha770c72_0    conda-forge
qtpy                      2.4.1              pyhd8ed1ab_0    conda-forge
readline                  8.2                  h8228510_1    conda-forge
referencing               0.33.0             pyhd8ed1ab_0    conda-forge
requests                  2.31.0             pyhd8ed1ab_0    conda-forge
rfc3339-validator         0.1.4              pyhd8ed1ab_0    conda-forge
rfc3986-validator         0.1.1              pyh9f0ad1d_0    conda-forge
rpds-py                   0.18.0           py39h9fdd4d6_0    conda-forge
scikit-learn              1.1.3            py39hd5c8da3_1    conda-forge
scipy                     1.12.0           py39h474f0d3_2    conda-forge
send2trash                1.8.2              pyh41d4057_0    conda-forge
setuptools                69.1.0             pyhd8ed1ab_1    conda-forge
sip                       6.7.12           py39h3d6467e_0    conda-forge
six                       1.16.0             pyh6c4a22f_0    conda-forge
smopy                     0.0.8              pyhd8ed1ab_0    conda-forge
snappy                    1.1.10               h9fff704_0    conda-forge
sniffio                   1.3.0              pyhd8ed1ab_0    conda-forge
soupsieve                 2.5                pyhd8ed1ab_1    conda-forge
sqlite                    3.45.1               h2c6b66d_0    conda-forge
stack_data                0.6.2              pyhd8ed1ab_0    conda-forge
terminado                 0.18.0             pyh0d859eb_0    conda-forge
threadpoolctl             3.3.0              pyhc1e730c_0    conda-forge
tiledb                    2.13.2               hd532e3d_0    conda-forge
tinycss2                  1.2.1              pyhd8ed1ab_0    conda-forge
tk                        8.6.13          noxft_h4845f30_101    conda-forge
toml                      0.10.2             pyhd8ed1ab_0    conda-forge
tomli                     2.0.1              pyhd8ed1ab_0    conda-forge
tomlkit                   0.12.3             pyha770c72_0    conda-forge
tornado                   6.4              py39hd1e30aa_0    conda-forge
traitlets                 5.14.1             pyhd8ed1ab_0    conda-forge
types-python-dateutil     2.8.19.20240106    pyhd8ed1ab_0    conda-forge
typing-extensions         4.9.0                hd8ed1ab_0    conda-forge
typing_extensions         4.9.0              pyha770c72_0    conda-forge
typing_utils              0.1.0              pyhd8ed1ab_0    conda-forge
tzcode                    2024a                h3f72095_0    conda-forge
tzdata                    2024a                h0c530f3_0    conda-forge
unicodedata2              15.1.0           py39hd1e30aa_0    conda-forge
uri-template              1.3.0              pyhd8ed1ab_0    conda-forge
uriparser                 0.9.7                hcb278e6_1    conda-forge
urllib3                   2.2.1              pyhd8ed1ab_0    conda-forge
wcwidth                   0.2.13             pyhd8ed1ab_0    conda-forge
webcolors                 1.13               pyhd8ed1ab_0    conda-forge
webencodings              0.5.1              pyhd8ed1ab_2    conda-forge
websocket-client          1.7.0              pyhd8ed1ab_0    conda-forge
wheel                     0.42.0             pyhd8ed1ab_0    conda-forge
widgetsnbextension        4.0.10             pyhd8ed1ab_0    conda-forge
xcb-util                  0.4.0                h5[1690](https://github.com/FZJ-IEK3-VSA/ETHOS_Suite_Test_Orchestrator/actions/runs/8019786963/job/21908272931#step:3:1691)9a_0    conda-forge
xcb-util-image            0.4.0                h166bdaf_0    conda-forge
xcb-util-keysyms          0.4.0                h516909a_0    conda-forge
xcb-util-renderutil       0.3.9                h166bdaf_0    conda-forge
xcb-util-wm               0.4.1                h516909a_0    conda-forge
xerces-c                  3.2.4                h55805fa_1    conda-forge
xkeyboard-config          2.38                 h0b41bf4_0    conda-forge
xorg-kbproto              1.0.7             h7f98852_1002    conda-forge
xorg-libice               1.1.1                hd590300_0    conda-forge
xorg-libsm                1.2.4                h7391055_0    conda-forge
xorg-libx11               1.8.4                h0b41bf4_0    conda-forge
xorg-libxau               1.0.11               hd590300_0    conda-forge
xorg-libxdmcp             1.1.3                h7f98852_0    conda-forge
xorg-libxext              1.3.4                h0b41bf4_2    conda-forge
xorg-libxrender           0.9.10            h7f98852_1003    conda-forge
xorg-renderproto          0.11.1            h7f98852_1002    conda-forge
xorg-xextproto            7.3.0             h0b41bf4_1003    conda-forge
xorg-xproto               7.0.31            h7f98852_1007    conda-forge
xz                        5.2.6                h166bdaf_0    conda-forge
yaml                      0.2.5                h7f98852_2    conda-forge
zeromq                    4.3.5                h59595ed_0    conda-forge
zipp                      3.17.0             pyhd8ed1ab_0    conda-forge
zlib                      1.2.13               hd590300_5    conda-forge
zstd                      1.5.5                hfc55251_0    conda-forge

"GDAL_DATA" path error when installing/using geokit

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:

error_image

The error is caused by a conflicting path in a system variable called "GDAL_DATA". I followed these steps to solve it:

  1. Install the latest version of Geokit following the installation instructions provided.

  2. 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, like coordinate_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.

path_image

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.

  1. 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

Sytem_variables_window

  1. Restart the computer.

  2. 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()

image

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.

  1. Import geokit with no errors

no_error_image

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

update README with conda install procedure

The README does not mention yet that geokit can now be installed via conda install geokit -c conda-forge very easily. This should be mentioned even as the first since probably easiest option in the README.

We may also want to check if the other installation options still work properly.

@shitabishmam

Gdal 3.4.1 causes tests to fail on Windows and Mac

Gdal 3.4.1 should be excluded from the dependencies.

It causes the folowing error in multiple tests:

ImportError: DLL load failed while importing _gdal: The specified procedure could not be found.

The failed tests are:

geokit/geokit/test/test_01_util.py
geokit/geokit/test/test_02_srs.py
geokit/geokit/test/test_03_geom.py
geokit/geokit/test/test_04_raster.py
geokit/geokit/test/test_05_vector.py
geokit/geokit/test/test_06_extent.py
geokit/geokit/test/test_07_locations.py
geokit/geokit/test/test_08_regionmask.py
geokit/geokit/test/test_09_algorithms.py

The complete log is attached in a file.
log.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.