Skip to content

Commit

Permalink
Update installation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainv committed May 23, 2024
1 parent 6c336dd commit 4ab8494
Showing 1 changed file with 59 additions and 13 deletions.
72 changes: 59 additions & 13 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ The ``geefcc`` package depends on the `xee <https://github.com/google/Xee>`_ Pyt
Prerequisites
=============

Access to Google Earth Engine
-----------------------------

To use the ``geefcc`` Python package, you need a Google account and an `access to Earth Engine <https://developers.google.com/earth-engine/guides/access#a-role-in-a-cloud-project>`_ either via a Google Cloud project that's registered to use Earth Engine or via an individually signed-up account. Please follow this link `to register for Earth Engine <https://code.earthengine.google.com/register>`_.

You must always initialize GEE before using ``geefcc`` functions specifying a Google Cloud project name and `Earth Engine high-volume endpoint <https://developers.google.com/earth-engine/cloud/highvolume>`_:
Expand All @@ -49,33 +52,76 @@ You must always initialize GEE before using ``geefcc`` functions specifying a Go
opt_url="https://earthengine-highvolume.googleapis.com"
)
GDAL
----

GDAL must be installed on your system.

To install GDAL on Windows, use the `OSGeo4W <https://trac.osgeo.org/osgeo4w/>`_ network installer. OSGeo4W is a binary distribution of a broad set of open source geospatial software for Windows environments (Windows 11 down to 7). Select *Express Install* and install GDAL. Several Gb of space will be needed on disk to install this programs. This will also install *OSGeo4W Shell* to execute command lines.

To install GDAL on other systems, use your package manager, for example ``apt`` for Debian/Ubuntu Linux distributions.

.. code:: shell
sudo apt update
sudo apt install gdal-bin libgdal-dev
After installing GDAL, you can test the installation by running ``gdalinfo --version`` in the command prompt or terminal, which should display the installed GDAL version.

GADM website
------------

The ``geefcc`` package downloads country administrative borders from the `GADM <https://gadm.org/data.html>`_ website. From time to time, their server is not responding. In case of problem with downloading country borders, check directly on the GADM website that data can be downloaded manually to be sure that the problem is coming from ``geefcc``.

Installation
============

The easiest way to install the ``geefcc`` Python package is via `pip <https://pip.pypa.io/en/stable/>`_:
The easiest way to install the ``geefcc`` Python package is via `pip <https://pip.pypa.io/en/stable/>`_ in the *OSGeo4W Shell* for Windows or in a virtual environment for Linux.

For Linux, create and activate a virtual environment before install ``geefcc`` with ``pip``:

.. code-block:: shell
.. code-block:: bash
cd ~
# Create a directory for virtual environments
mkdir venvs
# Create the virtual environment with venv
python3 -m venv ~/venvs/venv-geefcc
# Activate (start) the virtual environment
source ~/venvs/venv-geefcc/bin/activate
$ # For last stable version on PyPI
$ python -m pip install geefcc
Install Python dependencies and ``geefcc`` in the *OSGeo4W Shell* or in the newly created virtual environment:

.. code-block:: shell
# Upgrade pip, setuptools, and wheel
python3 -m pip install --upgrade pip setuptools wheel
# Install numpy
python3 -m numpy
# Install gdal Python bindings (the correct version)
python3 -m pip install gdal==$(gdal-config --version)
# Install geefcc. This will install all other dependencies
python3 -m pip install geefcc
or
If you want to install the development version of ``geefcc``, replace the last line with:

.. code-block:: bash
.. code-block:: shell
$ # For development version on GitHub
$ python -m pip install https://github.com/ghislainv/geefcc/archive/master.zip
python3 -m pip install https://github.com/ghislainv/geefcc/archive/master.zip
but you can also install ``geefcc`` executing the ``setup.py`` file:
To deactivate and delete the virtual environment:

.. code-block:: bash
.. code-block:: shell
deactivate
rm -R ~/venvs/venv-geefcc # Just remove the repository
$ git clone https://github.com/ghislainv/geefcc
$ cd geefcc
$ python setup.py install
In case of problem while installing GDAL Python bindings, try the following command:

.. code-block:: shell
python3 -m pip install --no-cache-dir --force-reinstall gdal==$(gdal-config --version)
Contributing
============

Expand Down

0 comments on commit 4ab8494

Please sign in to comment.