Installing GeoWombat#

Install with pip#

If your system has GDAL installed, then geowombat can be installed via pip directly from the GitHub repository.

Install directly from the GitHub.com repository:

pip install git+https://github.com/jgrss/geowombat

Install with Conda#

If you have issues installing GDAL then Conda provides an easy and consistent installation method regardless of operating system. See the Conda installation instructions for setup.

Installing geowombat from the conda-forge channel can be achieved by adding conda-forge to your channels with:

conda config --add channels conda-forge
conda config --set channel_priority strict

Once the conda-forge channel has been enabled, geowombat can be installed with conda:

conda install geowombat

or with mamba:

mamba install geowombat

Alternatively, install in one line following the GeoWombat Conda page:

conda install -c conda-forge geowombat

Detailed install#

The GDAL binaries must be installed prior to installing geowombat. Below are instructions on how to build GDAL for your operating system.

Install gcc to compile and install GDAL. On OSX, these are easiest to install via homebrew.

From the terminal window, update brew and install:

brew update
brew upgrade
brew install gcc
brew install gdal openssl spatialindex

Test the installation#

Test the import#

If geowombat installed correctly, you should be able to run the following command from the terminal:

python -c "import geowombat as gw;print(gw.__version__)"

or in Python:

In [1]: import geowombat as gw

In [2]: print(gw.__version__)
2.1.17

Unittests#

Install testfixtures (used to test logging outputs in test_config.py):

pip install testfixtures

Run all unittests inside the /tests directory:

cd geowombat/tests
python -m unittest

Run an individual test:

python test_open.py

Installation Notes#

Note

GDAL install: GeoWombat requires GDAL and libspatialindex.

This GDAL requirement is a prerequisite itself for the Python GDAL bindings.

Note

GDAL Paths in Linux: Although we think this is now resolved, earlier GDAL installations had issues with paths. If this is the case, try updating the environment paths:

export CPLUS_INCLUDE_PATH=/usr/include/gdal
export C_INCLUDE_PATH=/usr/include/gdal
export LD_LIBRARY_PATH=/usr/local/lib

# Optional, add permanently to a .profile file
# echo 'export CPLUS_INCLUDE_PATH="/usr/include/gdal"' >> ~/.profile
# echo 'export C_INCLUDE_PATH="/usr/include/gdal"' >> ~/.profile
# echo 'export LD_LIBRARY_PATH="/usr/local/lib"' >> ~/.profile

Note

EPSG File Missing in Linux: If you install GDAL 3.x on Ubuntu, when importing rasterio you may receive an error saying

CPLE_OpenFailedError: Unable to open EPSG support file gcs.csv

This error is documented on rasterio’s ReadTheDocs page and GitHub page. If the suggested solutions do not fix the issue, you can try setting the GDAL_DATA environment variable to point to Fiona (which will be installed automatically when installing GeoWombat). For example, if you have setup a virtual environment, the GDAL_DATA variable can point to /path/to/myenv/lib/python3.8/site-packages/fiona/gdal_data, where /path/to/myenv is the name of your virtual environment path directory. Change 3.8 if using a different Python version.