A Python module for spatial data handling
Project description
spatialist
A Python module for spatial data handling
This package offers functionalities for user-friendly geo data processing using GDAL and OGR.
Documentation
A description of spatialist's functionality can be found here.
Tutorial
We are currently developing a tutorial jupyter notebook spatialist_tutorial.ipynb. You can interactively use it by launching binder on the top.
Installation of dependencies
If you are using Windows, the easiest way to work with spatialist and Python in general is by using Anaconda. It comes with all basic requirements of spatialist. The more specific instructions below are intended for Linux users.
GDAL
spatialist requires GDAL version 2.1 with GEOS and PROJ4 as dependencies as well as the GDAL Python binding. Alternatively, one can use pygdal, a virtualenv and setuptools friendly version of standard GDAL python bindings.
Ubuntu
Starting with release Yakkety (16.10), Ubuntu comes with GDAL >2.1. See here. You can install it like this:
sudo apt-get install python-gdal python3-gdal gdal-bin
For older Ubuntu releases you can add the ubuntugis repository to apt prior to installation to install version >2.1:
sudo add-apt-repository ppa:ubuntugis/ppa
sudo apt-get update
This way the required dependencies (GEOS and PROJ4 in particular) are also installed. You can check the version by typing:
gdalinfo --version
Debian
Starting with Debian 9 (Stretch) GDAL is available in version >2.1 in the official repository.
Building from source
Alternatively, you can build GDAL and the dependencies from source. The script spatialist/install/install_deps.sh
gives specific instructions on how to do it. It is not yet intended to run this script via shell, but rather to
follow the instructions step by step.
SQLite + SpatiaLite
While sqlite3 and its Python binding are usually already installed, the spatialite extension needs to be added. Two packages exist, libspatialite and mod_spatialite. Both can be used by spatialist. mod_spatialite has been found to be easier to setup with sqlite and can be installed via apt:
sudo apt-get install libsqlite3-mod-spatialite
The following can be run in Python to test the needed functionality:
import sqlite3
# setup an in-memory database
con=sqlite3.connect(':memory:')
# enable loading extensions and load spatialite
con.enable_load_extension(True)
try:
con.load_extension('mod_spatialite.so')
except sqlite3.OperationalError:
con.load_extension('libspatialite.so')
In case loading extensions is not permitted you might need to install the package pysqlite2
.
See the script spatialist/install/install_deps.sh
for instructions.
There you can also find instructions on how to install spatialite from source.
To test pysqlite2
you can import it as follows and then run the test above:
from pysqlite2 import dbapi2 as sqlite3
Installing this package is likely to cause problems with the sqlite3 library installed on the system. Thus, it is safer to build a static sqlite3 library for it (see installation script).
Installation of spatialist
For the installation we need the Python tool pip and the version control system git. On Windows, pip is installed together with Anaconda. Git can be installed like this:
conda install git
On Linux:
sudo apt-get install python-pip git
Once everything is set up, spatialist is ready to be installed. You can install stable releases like this:
python -m pip install spatialist
or the latest developer version like this:
sudo python -m pip install git+https://github.com/johntruckenbrodt/spatialist.git
On Windows you need to use the Anaconda Prompt and leave out sudo
in the above command.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for spatialist-0.2.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49d8fe5d4a85f3ff17a4b2434407d5ee35933f60dbd5fa805df98750ee424d1b |
|
MD5 | 2bd5f53c38824e119c19b7259351c39a |
|
BLAKE2b-256 | 9220c29fd03a9473eb68a2b8afb4594596fe7035c02b3d22549f13b63cf74641 |
Hashes for spatialist-0.2.5-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c244bc01c91e14c330a78292f7dab14e3c05acf2a6172ab7c508cc60d7d44704 |
|
MD5 | d9a15c1fd516920b3b4851b09809160f |
|
BLAKE2b-256 | d2729f9b417503df47d99ffbd9caea75185ac76b8429099ba59f0fbf1a950421 |