bluegeo is a library developed to assist in geospatial development where core scientific python libraries such as numpy, scipy, scikit-image and scikit-learn can be implemented easily over raster and vector geospatial data.
For example:
import bluegeo as bg
import numpy as np
# Virtually read a raster file
r = bg.Raster('elevation.tif')
# Slice the data, returning a numpy array
# Note: Slice-based __getitem__ operations are supported, but fancy indexing is not
a = np.ma.masked_equal(r[:], r.nodata)
# Perform a numpy operation
print(a.mean())
784.91772
bluegeo requires python 3, and a system installation of GDAL and GRASS
Clone the bluegeo repo
git clone https://github.com/bluegeo/bluegeo.git
from the root:
pip install .
Build the image (from the root dir)
docker build -t bluegeo .
Start a session in the container
docker run --rm -v /home/ubuntu/bluegeo/scratch:/scratch -it bluegeo /bin/bash
Note:
- To preserve the container, do not use the
--rm
flag. - A
scratch
directory (absolute path) is mounted to share files - omit it if necessary.
The easiest way to use bluegeo is on Linux, using the privision.sh
script to install the dependencies:
bluegeo/provision.sh
Re-initialize conda & activate the environment:
eval "$(~/miniconda/bin/conda shell.bash hook)"
conda activate bluegeo
Test the installation
python
>>> import bluegeo as bg
>>>