a spatial networks toolkit
Project description
snkit - a spatial networks toolkit
/ˈsnɪkɪt/ – sounds like snicket (noun, Northern English) A narrow passage between houses; an alleyway.
Why use snkit?
snkit
helps tidy spatial network data.
Say you have some edges and nodes (lines and points, connections and vertices). None of them are quite connected, and there's no explicit data to define which node is at the end of which edge, or which edges are connected.
For example:
snkit
has methods to:
- add endpoints to each edge
- connect nodes to nearest edges
- split edges at connecting points
- create node and edge ids, and add from_id and to_id to each edge
Spatial network
The output of a snkit data cleaning process might look something like this:
Nodes
geometry | id | other attributes... |
---|---|---|
POINT (0.03 0.04) |
node_0 | ... |
POINT (0.03 0.03) |
node_1 | ... |
POINT (0.02 0.03) |
node_2 | ... |
Edges
geometry | id | from_id | to_id | other attributes... |
---|---|---|---|---|
LINESTRING (0.04 -0.04... |
edge_0 | node_10 | node_22 | ... |
LINESTRING (0.01 -0.03... |
edge_1 | node_22 | node_21 | ... |
LINESTRING (0.02 -0.02... |
edge_2 | node_21 | node_25 | ... |
Getting started
Install system libraries (only tested on Ubuntu):
sudo apt-get install -y libspatialindex-dev libgeos-dev gdal-bin
Or use conda to install major dependencies:
conda install pandas geopandas shapely rtree fiona
Install or upgrade snkit
using pip:
pip install --upgrade snkit
See the demo notebook for a small demonstration.
Testimonials 💯 👍 😊
With five lines of snkit I replaced four or five hundred lines of custom code!
A. Contented Customer (@czor847)
Related projects
pysal/spaghetti
has methods for building graph-theoretic networks and the analysis of network events.osmnx
lets you retrieve, model, analyze, and visualize street networks from OpenStreetMap, including methods to correct and simplify network topology.
Acknowledgements
MIT License
Copyright (c) 2018 Tom Russell and snkit contributors
Initial snkit development was at the Environmental Change Institute, University of Oxford within the EPSRC sponsored MISTRAL programme, as part of the Infrastructure Transition Research Consortium.
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
File details
Details for the file snkit-0.1.5.tar.gz
.
File metadata
- Download URL: snkit-0.1.5.tar.gz
- Upload date:
- Size: 68.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.1.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d118e29ced1e1fc221000d192a91eead309a040263465c9c62d65e969222d65 |
|
MD5 | 25e636f04f8065b378462cde25d89514 |
|
BLAKE2b-256 | 502de92a4cffd1a961fb7ecbeab5f54e6d2e6bce4542d3b9513b15b471eaab2c |